[CLOSED] Autoload / Preload Tab Panels
I have a tab panel with two tabs that I am trying to pre-load so the user does not perceive any wait period when clicking on the second tab. I have tried various uses of AutoLoad(true). I have also tried some code that I saw that loops through all the tabs in javascript and calls setActiveTab on every tab but this only makes the last tab the active tab.
Given the following example, is there anyway to cause the 2nd tab to pre-load while still having loaded and displayed tab 1?
Code:
@{
Layout = "~/Views/Shared/_BaseLayout.cshtml";
var X = Html.X();
}
@section headtag
{
}
@section example
{
@(X.Window()
.Title("test auto load tabs")
.Width(700)
.Height(500)
.Icon(Icon.Link)
.Layout(LayoutType.Border)
.Items(
X.TabPanel()
.ID("TabPanel1")
.Region(Region.Center)
.Items(
X.Panel()
.ID("tab1")
.Title("tab 1")
.Closable(false)
.Loader(Html.X().ComponentLoader().Url("http://www.microsoft.com")
.Mode(LoadMode.Frame)
.LoadMask(lm =>
{
lm.ShowMask = true;
lm.Msg = "Loading 1 ...";
}))
,
X.Panel()
.ID("tab2")
.Title("tab 2")
.Closable(false)
.Loader(X.ComponentLoader().Url("http://www.ext.net")
.Mode(LoadMode.Frame)
.LoadMask(lm =>
{
lm.ShowMask = true;
lm.Msg = "Loading 2 ...";
}))
)
)
)
}