I have a kendo grid in a kendo PanelBar (actually, I have a few kendo grids in a few kendo panelbars in the same page), and to eliminate a long load time, I don;t want to actually retrieve the grids data until the specific PanelBar get's expanded. I figured out the Expand event, but how do I configure my Grid to get the data based on that event?
<
ul
id
=
"panelbar"
>
<
li
id
=
"item1"
>
<
b
>Names</
b
>
<
div
id
=
"SampleNamesGrid"
></
div
>
@(Html.Kendo().Grid<
SampleName
>().Name("SampleNamesGrid")
.TableHtmlAttributes(new {@class = "table-condensed"})
.Columns(c =>
{
c.Bound(sn => sn.ID);
c.Bound(sn => sn.FirstName);
c.Bound(sn => sn.LastName);
})
.DataSource(d => d
.Ajax()
.Read(r => r.Action("GetNames", "SampleNames").Type(HttpVerbs.Get))
.PageSize(20)
)
.Pageable()
.Filterable()
.Sortable())
</
li
>
</
ul
>
<
script
>
$("#panelbar").kendoPanelBar({
expand: Expand
});
function Expand(e) {
alert("open");
}
</
script
>