Hello!
We use Web KendoUI Grid (v.2013.3.1127).
We have a grid with defined DataSource and things (sorting/paging/filtering) works as intended.
But we have a problem when we trying to implement following:
We try to dynamically bind given grid to JSON data on first page load (which are part of data we load when user brings given page for first time) to save additional hit to server.
We do something like this:
This works well and data are there, but we have a difficulty how to set paging properties on these data, for example how to set a dataSource.total property.
We tried:
and we also tried:
But this do not works too.
So our question is: How to properly set paging properties while dynamically binding JSON data to the Web KendoUI Grid?
thanks in advance,
Igor.
We use Web KendoUI Grid (v.2013.3.1127).
We have a grid with defined DataSource and things (sorting/paging/filtering) works as intended.
But we have a problem when we trying to implement following:
We try to dynamically bind given grid to JSON data on first page load (which are part of data we load when user brings given page for first time) to save additional hit to server.
We do something like this:
$.ajax({
url: ...
/
getViewModel
/
,
dataType:
"json"
,
success: function (JsonResult) {
...
$(
"#grid"
).data(
"kendoGrid"
).dataSource.data(JsonResult.GridResults.GridData);
...
}
...
}
This works well and data are there, but we have a difficulty how to set paging properties on these data, for example how to set a dataSource.total property.
We tried:
$(
"#grid"
).data(
"kendoGrid"
).dataSource.data(JsonResult. GridResults.GridData);
//ok
$(
"# grid "
).data(
"kendoGrid"
).dataSource.total(JsonResult.GridResults.GridTotalRecordCount);
// do not works
and we also tried:
var
grid = $(
"#grid"
).data(
"kendoGrid"
);
// ok
var
newDS =
new
kendo.data.DataSource({
data: JsonResult.GridResults.GridData ,
total: JsonResult.GridResults.GridTotalRecordCount
});
grid.setDataSource(newDS);
But this do not works too.
So our question is: How to properly set paging properties while dynamically binding JSON data to the Web KendoUI Grid?
thanks in advance,
Igor.