This question is locked. New answers and comments are not allowed.
In my app, I have a panel in a panel bar with a series of filters. On the "OnExpand" event of this panel, I have to populate a grid inside the next panel based in the chosen filters. I'm doing this via this functions:
function onExpand(e) {
var item = $(e.item);
var element = (item.find('> .t-link').text());
if (element == 'ConcessionĂ¡rias') {
var grid = $("#Grid").data("tGrid");
grid.rebind()
}
}
function gridConcessionariaDataBiding(e) {
e.data = {
param: parameters()
};
}
This works (not sure if is the best way, but works anyway). Howevar, my grid (below) is calling the server when the page is first loaded, when there's no filters selected, thus, making a worthless request. What I need is that this grid only make the databind by client request - do not load values on pageload. Can I have some help?
@(Html.Telerik().Grid<SicofgII.EntityDataModel.Concessionaria>()
.Name("Grid")
.ClientEvents(events => events.OnDataBinding("gridConcessionariaDataBiding"))
.Columns(columns =>
{
columns.Bound(o => o.idConcessionaria)
.ClientTemplate("<input type='checkbox' name='checkedConcessionaria' value='<#= idConcessionaria #>' />")
.Title("")
.Width(36)
.HtmlAttributes(new { style = "text-align:center" });
columns.Bound(o => o.Sigla).Width(120);
columns.Bound(o => o.NomeFantasia);
})
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("loadConcessionarias", "Calculo")
.OperationMode(GridOperationMode.Client))
.Sortable()
.Footer(false)
.Scrollable())
function onExpand(e) {
var item = $(e.item);
var element = (item.find('> .t-link').text());
if (element == 'ConcessionĂ¡rias') {
var grid = $("#Grid").data("tGrid");
grid.rebind()
}
}
function gridConcessionariaDataBiding(e) {
e.data = {
param: parameters()
};
}
This works (not sure if is the best way, but works anyway). Howevar, my grid (below) is calling the server when the page is first loaded, when there's no filters selected, thus, making a worthless request. What I need is that this grid only make the databind by client request - do not load values on pageload. Can I have some help?
@(Html.Telerik().Grid<SicofgII.EntityDataModel.Concessionaria>()
.Name("Grid")
.ClientEvents(events => events.OnDataBinding("gridConcessionariaDataBiding"))
.Columns(columns =>
{
columns.Bound(o => o.idConcessionaria)
.ClientTemplate("<input type='checkbox' name='checkedConcessionaria' value='<#= idConcessionaria #>' />")
.Title("")
.Width(36)
.HtmlAttributes(new { style = "text-align:center" });
columns.Bound(o => o.Sigla).Width(120);
columns.Bound(o => o.NomeFantasia);
})
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("loadConcessionarias", "Calculo")
.OperationMode(GridOperationMode.Client))
.Sortable()
.Footer(false)
.Scrollable())