I'm trying to bind to a custom transport and get paging to work. Essentially I have a function that retrieves a set of records and places them on a view model as a list. I'm overridding the total count of the grid by retrieving it from a column on the data, like this:
dataSource: new kendo.data.DataSource({
data: this.results,
schema: {
data: function (data) {
return data;
},
total: function(data) {
if (data.length > 0) {
return data[0].rowCount;
}
return 0;
},
type: "json"
}
}),
I have two issues, however. First is that when I set the total count, I get "NaN - NaN of 1000 total items" on the grid. Not sure where the NaN is coming from. Second, I need to fetch the next page when the user interacts with the paging control. Again, I'm not pointing the kendo grid to an API end point, I'm fetching that data myself and just binding to a list. Is there a way I can intercept the paging event so that I can load the next page of data and refresh the binding for the grid?
dataSource: new kendo.data.DataSource({
data: this.results,
schema: {
data: function (data) {
return data;
},
total: function(data) {
if (data.length > 0) {
return data[0].rowCount;
}
return 0;
},
type: "json"
}
}),
I have two issues, however. First is that when I set the total count, I get "NaN - NaN of 1000 total items" on the grid. Not sure where the NaN is coming from. Second, I need to fetch the next page when the user interacts with the paging control. Again, I'm not pointing the kendo grid to an API end point, I'm fetching that data myself and just binding to a list. Is there a way I can intercept the paging event so that I can load the next page of data and refresh the binding for the grid?