jqGrid seems to display the first page only, and the server seems to be right.
Here's js:
$("#gpaTable").jqGrid({
datatype: "local",
pager: "#gpaPager",
viewrecords: true,
jsonReader: {
repeatitems: true,
id: "lineId",
cell: "cell",
root: "rows",
records: "records",
total: "pageTotal",
page: "pageId"
},
...
});
$("#gpaTable").jqGrid("navGrid", "#gpaPager", { edit: false, add: false, del: false });
$.ajax({
type: 'POST',
url: 'alarmInfo.aspx',
data: { lowestGpa: '1.7' },
dataType: "json",
success: function (data) {
var rows = data['rows'];
var cnt = rows.length;
for (var i = 0; i < cnt; ++i) {
$("#gpaTable").jqGrid("addRowData", i + 1, rows[i]["cell"]);
}
}
});
And the content returned from server (using ASP.NET) is:
{
"pageId": "1",
"pageTotal": "4",
"records": "100",
"rows": [{
"cell": {
"expectGpa": "2.0",
"failRestCnt": 1,
"failTotalCnt": 3,
"lastGpa": 0.0,
"lowScore": "",
"name": "name0063",
"noScore": 13,
"star": " ",
"studentId": "5090379063"
},
"lineId": 1
} // ...
]
}
pageTotal
, pageId
and records
seem not to be used. And from chrome console and firebug, I can't find parameters concerning paging sent to server.
What's the problem here?