Is it possible to override behaviour of jqgrid when passing data from client side? I know it is when fetching data from the server, but my issue is different. Here is jsfiddle link: http://jsfiddle.net/fott25/wdvsjwrg/
I will post my code here also, my html:
<table id="list"></table>
<div id="pager"></div>
And this is my javascript with data and jqgrid initialization in it:
var myData = [{
id: 1,
name: "aaz"
}, {
id: 2,
name: "bbz"
}, {
id: 3,
name: "ccz"
}, ];
$("#list").jqGrid({
datastr: myData,
datatype: "jsonstring",
jsonReader: {
page: function(datastr) {
return 2;
},
total: function(datastr) {
return 10;
},
},
colNames: ["Id", "Name"],
colModel: [{
name: "id",
index: "id",
sorttype: "int"
}, {
name: "name",
index: "name"
}],
rowNum:1,
caption: "Viz Test",
pager: '#pager',
});
This is the result of the code:
As you can see, I tried to set total number of pages to 10 in jsonReader properties, but jqgrid ignores that prop. Setting page to second is working just fine. Is it possible to override total page number?
EDIT #1: i tried setting lastpage to 10, but it is not working