Not initialized objects inside accordion

Hello dear support. I have the follow issue - I have a few components which have to be initialized inside the accordions but they are not before I expand the accordion.
Is there something like "Persistent" or something which will initialize all objects inside the accordion even if not expanded ?

<SfAccordion >
                            <AccordionItems>
                                <AccordionItem >
                                    <HeaderTemplate>@( TranslatorEX.BG.WeatherInTheMomentForCity + " " + lastSelectedCity ) </HeaderTemplate>
                                    <ContentTemplate>

                                        <WeatherUIObject @ref="fcr1_0" />
                                        <WeatherUIObject @ref="fcr1_1" />
                                        <WeatherUIObject @ref="fcr1_2" />
                                        <WeatherUIObject @ref="fcr1_3" />
                                        <WeatherUIObject @ref="fcr1_4" />
                                        <WeatherUIObject @ref="fcr1_5" />
                                        <WeatherUIObject @ref="fcr1_6" />
                                        <WeatherUIObject @ref="fcr1_7" />
                                    </ContentTemplate>
                                </AccordionItem>

                            </AccordionItems>
                        </SfAccordion>

5 Replies 1 reply marked as answer

BS Balasubramanian Sattanathan Syncfusion Team October 7, 2020 11:24 AM UTC

Hi Yordan, 

Greetings from Syncfusion Support. 

We have validated your reported problem “Not initialized objects inside accordion” at our side and prepared a sample based on that by using the below code snippets. In the below sample, we have rendered the button component in the accordion content. Since the button component has been initialized properly in the accordion content. So we would suggest you to refer and follow the below sample and UG. 

Code snippet: 
<SfAccordion @ref="@Accordion"> 
    <AccordionItems> 
        <AccordionItem Expanded="true" Header="Video"> 
            <ContentTemplate> 
                <SfButton @onclick="AddItemClick" Content="ADD Item"></SfButton> 
            </ContentTemplate> 
        </AccordionItem> 
       
       
       
    </AccordionItems> 
</SfAccordion> 


Kindly try the above links and let us know if you need further assistance. 

Regards, 
Balasubramanian S 



YO Yordan October 7, 2020 11:26 AM UTC

Hello dear support. The problem is that I need to have reference to these objects without the AccordionItem been expanded.


BS Balasubramanian Sattanathan Syncfusion Team October 8, 2020 01:12 PM UTC

Hi Yordan, 

Thanks for the reply. 

We have analyzed your reported scenario “The problem is that I need to have reference to these objects without the AccordionItem been expanded.” at our side and let you know that it can be achieved by setting the LoadOnDemand property as false. Which can be available from the version 18.3.35. For your reference, we have modified the already shared sample that can be downloaded from the below link. 

Code snippet
<SfAccordion @ref="@Accordion" LoadOnDemand=false

Kindly try the above solution and let us know if you need further assistance. 

Regards, 
Balasubramanian S

Marked as answer

YO Yordan October 8, 2020 02:53 PM UTC

Worker. Never knew this property existed.
Thank You dear support !



VM Vengatesh Maniraj Syncfusion Team October 9, 2020 06:36 AM UTC

Hi Yordan, 

You are most welcome.  

We are happy that our solution has fulfilled your requirement. 

Please get in touch with us if you need any further assistance. 

Regards, 
Vengatesh  


Loader.
Up arrow icon