I am trying to load grid data virtually with jqGrid
My issue is, i have set the rowNum as 100. I am getting 100 unique records. Each unique record may have multiple sub records.
From the above image country and state make a uniques record and subrecords are city, attraction and zipcode.
I am using this example to group the row levels
Jqgrid - grouping row level data
my grid displays 100 unique records but with the above example i will be loading around 130 rows.
when i am trying to scroll and when i reach 70th row, second page of data is loading and overwriting the last few records of the first 100 unique records.
Please let me know what is best way to set the rowNum dynamically so that when i reach the last 100th unique record the it should load the second page of grid data.
Below is the code i am using.
$("#myTable").jqGrid({
url: '../myUrl',
mtype: "POST",
shrinkToFit: false,
width: null,
height:505,
datatype: "json",
page: 1,
colModel: ospColModel,
rowNum: 100,
loadtext:"loading",
onSelectRow: editRow,
viewrecords: true,
scroll: 1,
emptyrecords: 'Scroll to bottom to retrieve new page',
jsonReader : {
root:function(obj){
return readRecords(obj);
},
page: function(obj){
return obj.PageNum;
},
records: function(obj){
return obj.TotalRecords;
},
total:function(obj){
return Math.round(obj.TotalRecords/100);
},
repeatitems: false
}
});