This is a migrated thread and some comments may be shown as answers.

Load on demand... when I demand?

1 Answer 101 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael Dunbar
Top achievements
Rank 2
Michael Dunbar asked on 07 Apr 2011, 03:09 PM

Regarding your TabStrip and more specifically it’s load on demand feature which as you say:

 

“The request is performed only once. After that the content is rendered on the page and TabStrip shows/hides it without performing additional Ajax requests.”

 

The issue I have is that I want to get the content again every time the user clicks the tab.

 

I’ve coded round the problem by add an onSelect javascript function which uses ajax to get the content of the tab – the problem here is that the first time the tab is clicked the event handler goes and gets the data, then the tab strip goes and gets it.

 

Is there any way to make the tab strip get the data every time the tab is clicked?

Thanks,

Michael.

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 12 Apr 2011, 07:28 AM
Hello Michael Dunbar,

The following onSelect handler should do what you requested:

function onSelect(e) {
    var $item = $(e.item),
        $content = $(e.contentElement);

    // if the item is dynamic (has ContentUrl) and has previously been fetched,
    // request it again

    if ($item.find('.t-link').data('ContentUrl') && !$content.is(':empty')) {
        $(this).data('tTabStrip').ajaxRequest($item, $content);
    }
}


All the best,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TabStrip
Asked by
Michael Dunbar
Top achievements
Rank 2
Answers by
Alex Gyoshev
Telerik team
Share this question
or