How to avoid collapsing tabstrip content (flickering) at loading tab dynamically?

1 Answer 224 Views
TabStrip
Christine
Top achievements
Rank 2
Iron
Christine asked on 05 May 2022, 09:01 AM

Hello,

I load content to a tabstrip dynamically via ContentUrl and Ajax.

Most of them have the same height (might differ slightly). 

When I click a tab item the first time, the content is collapsed and expanded, which leads to flickering. After the content of a tab is loaded once, it is fine.

I tried to set a fixed height and switched off animation -> did not solve the problem.

Are there any workarounds to pre-initialise the height of unloaded contents with the height of the selected item and adjust them dynamically  to the required height?

Any chance to avoid collapsing when loading the content dynamically?

Thanks,

Christine

1 Answer, 1 is accepted

Sort by
0
Accepted
Aleksandar
Telerik team
answered on 10 May 2022, 05:47 AM

Hello Christine,

One thing I can suggest is to use the reload method to fetch all the tabs after the TabStrip is initialized. This way when a user navigates to a tab it's content will already be loaded:

$("document").ready(function(){
        $('#tabstrip').getKendoTabStrip().reload($('#tabstrip ul li'))
    })

Here is a sample REPL demonstrating the above suggestion.

Regards,
Aleksandar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Christine
Top achievements
Rank 2
Iron
commented on 12 May 2022, 11:36 AM

Thanks, Aleksandar!

That helped me to find a good solution for my problem.

Best regards

Christine

Tags
TabStrip
Asked by
Christine
Top achievements
Rank 2
Iron
Answers by
Aleksandar
Telerik team
Share this question
or