TabItems inside SfTab are allways getting initialized when switching

Hello,

i am using a SfTab and adding TabItems dynamicaly setting the header to a string and the content to a component.

This component has a parameter i use inside this component to show some data based on this parameter. Therefor i use the OnIntializedAsync event.

Every time i switch from one tab to the other tab the component inside the tab is receiving the OnInitializedAsync and the previous already loaded data is getting overriden.

Does it work as designed or do i make some mistakes.

I am quite new to blazor components.

Thanks for you help

Cheers







3 Replies 1 reply marked as answer

PN Praveenkumar Narasimhanaidu Syncfusion Team March 22, 2021 12:03 PM UTC

Hi Ulrich, 

Greetings from Syncfusion support..! 

We have validated your query “TabItems inside SfTab are allways getting initialized when switching” and let you know that, by default the content of the selected tab alone will be loaded and available in DOM initially and it will be replaced with corresponding content if you select the tab dynamically. You can add ContentLoad.Init to the LoadOn property if you want to render the content of the all the tabs rendered in initial load itself and maintained in the DOM which will resolve your problem and for the same, we have prepared a sample which can be downloaded from following link. 


For more information about content rendering modes in SfTab please refer below documentation link. 

Kindly try the above solution and get back to us if you need any further assistance. 

Regards, 
Praveenkumar. 
 


Marked as answer

UL Ulrich March 25, 2021 12:10 PM UTC

Hello,

this is exactly what i was looking for.

Thanks you for your help and the great support.

Cheers

Ulrich


NR Nevitha Ravi Syncfusion Team March 26, 2021 09:00 AM UTC

Hi Ulrich, 

You are most welcome..! we are glad that our provided solution helped you, please get back to us if you need any further assistance. 

Regards, 
Nevitha  


Loader.
Up arrow icon