My problem lies with jQGrid and an OData data source (.NET WCF)
I am attempting to get jQgrid paging to work correctly, currently I have a basic data load and column sorting functioning.
I did this by overriding the xmlReader
function to get jQgrid to parse the OData XML
xmlReader: {
root: "feed",
row: "entry",
id: "entry>id",
total: "m:count"
}
Then on the request to the server I overrode the serializeGridData
function to attempt to send the requst in OData format.
serializeGridData: function (obj) {
obj["$inlinecount"] = "allpages";
obj["$orderby"] = obj.sidx + " " + obj.sord;
obj["$skip"] = (obj.page - 1) * obj.rows;
return obj;
}
But the problem is the OData response only contains the m:count
which is the total number of records. I believe jQGrid needs at least totalrecords
, currentpagenum
, and totalPages
to get the pagination to work correctly.
What am I missing?
A side question is how does Kendo UI Grid accomplish this and is there anything I can learn (or lift) from their code??
Server Side Paging Demo - http://demos.kendoui.com/web/grid/remote-data.html
Where the demo communicates with an oData source: http://demos.kendoui.com/service/Northwind.svc/Orders
Using the same oData format and getting the same response - lacking page number.