Latest Syncfusion depreciation on SFAccordion.Items

Afternoon All,

I have been using the Syncfusion Accordion for a few weeks now, However we updated our SyncFusion to the latest version 18.3.0.40  and some of the Accordion methods and parameters are now marked as depreciated .

We were previously using Accordion.Items which is now depreciated, and were wondering how we can now get a list of all the AccordionItem ,  We tried adding a Ref to AccordionItems but this does not expose the list of AccordionItem.

Any help would be appreciated.

Thank you
  

3 Replies 1 reply marked as answer

AK Alagumeena Kalaiselvan Syncfusion Team October 15, 2020 01:13 PM UTC

Hi Ashley, 

Greetings from Syncfusion support! 

We have checked your reported query and we deprecated few APIs/public methods from Accordion from the package version 18.3.0.35. For your scenario, we suggest to use tag level AccordioItem to render accordion items. Also we have prepared a sample based on your requirement and refer below code for that. 
[Index.razor] 
<SfAccordion @bind-ExpandedIndices="@expandedItem" @ref="AccordionReference"> 
    <AccordionItems> 
        @for (int i = 0; i < Data.Count; i++) 
        { 
            int j = i; 
            <AccordionItem Header="@Data[j].Header"> 
                <ContentTemplate> 
                    <div> 
                        <div><b>Employee ID: </b>@Data[j].EmployeeId</div> 
                        <div><b>Designation: </b>@Data[j].Content</div> 
                    </div> 
                </ContentTemplate> 
            </AccordionItem> 
        } 
    </AccordionItems> 
</SfAccordion> 

Also, the above sample can be get by the following link. 

Note: Refer the below link to know more about Accordion release changes  

Kindly get back to us, if you need better assistance. 

Regards 
Alagumeena.K 



DA Daten October 15, 2020 01:53 PM UTC

Good morning Alagumeena

I appreciate the response with code, however unless I am missing something,  This works for dynamically generating the Accordion Item,s  However for example If I am using each Accordion item for a booking form,  which does not have dynamic content (different fields and forms on each)  then I might be better off just creating a @ref for each AcordianItem and building my own list I think?

Also thank you for the link to the change logs, that was helpful in resolving another issue I had with the Scheduler! 

Thank you again!


AK Alagumeena Kalaiselvan Syncfusion Team October 16, 2020 01:40 PM UTC

Hi Ashley, 

Thanks for your update. 

Yes you can access the own list by creating @ref to individual AccordionItem

Please get back to us with below details, if you face any complexities 
  • Share the way as how did you build the own list?
  • Share the code behind of Accordion if possible
  • Share image reference of Accordion you expect

Regards 
Alagumeena.K 


Marked as answer
Loader.
Up arrow icon