I'm using LoadContentFrom
method of Kendo TabStrip
, it allows tabstrip to load content from another action method
.
The content will be loaded only when user clicks the link, tab, therefore it causes a short delay that I'd like to avoid. I wasn't able to find any method to enable eager loading for this control and load all the tabs at once. Any suggestion or workaround is welcome.
This is a sample tabstrip:
@(Html.Kendo().TabStrip()
.Name("tabstrip")
.Animation(false)
.SelectedIndex(0)
.Items(i =>
{
i.Add()
.Text("Action1")
.LoadContentFrom("Action1", "Controller");
i.Add()
.Text("Action2")
.LoadContentFrom("Action2", "Controller");
i.Add()
.Text("Action3")
.LoadContentFrom("Action3", "Controller");
})
)
UPDATE
Thanks to @joaumg, this is the JS code that I'm using:
$('#tabstrip').data().kendoTabStrip.reload($('#tabstrip ul li'))
Reload
method does the job and loads the tab, and $('#tabstrip ul li')
selector return an array of all tabs.