Hi JS-ers,
I’m loading data from server on the jqgrid. I’ve only 8 rows in the table data shown. To limit the rows shown on load I changed the rowList.
However, it didn’t work as expected.
1- I still get all 8 rows at once, on load.
2- If I change the row in the drop down, say 3. The pager button doesn’t get activated.
I still get page 1 of 1. If 3 rows are being show, then in this case it should be page 1 of 3.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
$("#grid_illume").jqGrid({ url:'test/xhr_get_data', datatype: "json", mtype: "GET", jsonReader: { repeatitems: false, id: "", root: function (obj) { return obj; }, records: function (obj) { return obj.length; }, page: function () { return 1; }, total: function () { return 1; } }, datatype: 'json', width: 'auto', colNames:['study','Sample Name','Forward Primer','Reverse Primer'], colModel :[ {name:"study",sortable: true}, {name: "sample_name",sortable: true}, {name: "forward_primer",sortable: true}, {name: "reverse_primer",sortable: true} ], rowNum:10, //this sets the default row in the pager pager: '#pager_illume', shrinkToFit : false, rownumbers: true, //row numbers on left multiselect: true, //check box height: '100%', //height: 'auto', gridview: true, viewrecords:true, // this is for the View 1 - 8 of 8 \m/ sortorder:"asc", //asc autoencode: true, //don't know sortable:true, //sort loadonce: false, //loadonce is must rowList:[3,6,9], //drop down caption:"jqGrid Illume Example" //title of the grid }); |
If I remove the jsonReader code, my pager starts acting weirdly. It shows duplicate rows, with pager working when 3 rows selected form the drop down. I can get page 45 of 1. Row 270. That’s strange.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top