I have recently upgraded my jqgrid from version 3 to 5.2.1, While doing so i faced unique problem while returning data from server side.
what i want, i am sending only 80 record from server side,with total records of 280, page=1 ad totalpage=4, but my jqgrid always show page 1 of 1 and displaying View 1 - 80 of 80 records, and rownum is 80.
it should display 1-80 from 280 and page 1 of 4.
Seems like my jqgrid ignoring the totalpages and totalrrecords.
Here is my jqgrid code:
jQuery("#tradeList").jqGrid(
{
jsonReader : {
id : "0"
},
url : 'getDetailAgingReportInternal.go',
datatype : 'jsonstring',
mtype : 'POST',
datastr : '{"page":' + data.page + ',"total":'
+ data.totalPages + ',"records":' + data.total
+ ',"rows": ' + data.rowData + '}',
colModel : data.colModel,
pager : '#pagerTrade',
rowNum : data.records,
rowList : [ 80, 160, 240 ],
viewrecords : true,
height: "350",
width : "auto",
viewsortcols : [ true, 'vertical', true ],
multiselect : data.multiselect,
multiboxonly: true,
onPaging : function(pgButton) {
var pageNo = getPageNo("tradeList");
var rowCount = getRowCount("tradeList");
loadDetailAgingReport(1, postData.bucketType, postData.mode, postData.modeType, '', '', postData.entity,
'', postData.entityId, postData.statusTypeId, postData.tradeTypeIdJson, postData.isOTC,
pageNo, rowCount, '', false, false);
return 'stop';
},
onSortCol : function(index, columnIndex, sortOrder) {
var colSort = {};
colSort.index = getColumnIndex("tradeList", columnIndex);
colSort.direction = sortOrder;
var colSortList = [ colSort ];
var pageNo = getPageNo("tradeList");
var rowCount = getRowCount("tradeList");
loadDetailAgingReport(1, postData.bucketType, postData.mode, postData.modeType, postData.colHeader, postData.statusType, postData.entity,
postData.colName, postData.entityId, postData.statusTypeId, postData.tradeTypeIdJson, postData.isOTC,
pageNo, rowCount, colSortList, false, false);
return 'stop';
},
gridComplete:function(){
}
});
What I have tried:
I have tried every solution possible in any site, since i dont want to change my code much, expecting a solution with minimum changes.