Reputation: 1
I get the result count from the server side and this count should be the total pages count.
The count is received correct and it should now be set as the total pages number.
How to accomplish this?
Upvotes: 0
Views: 203
Reputation: 36
It is possible to set the total page count in the before processing function of the source that you are defining. like this
var source =
{
datatype: "json",
datafields: [
{ name: 'studentId' },
{ name: 'studentName' },
{ name: 'Address' },
{ name: 'City' },
{ name: 'Country' }
],
url: 'remote server',
beforeprocessing: function (data) {
//refer the below example
source.totalrecords = data[0].TotalRows;
},
};
Upvotes: 1