My JQGrid’s Paginator not working as expected. Navigation buttons are working fine. But when enter the page number manually and pressed enter key, it is not working. I have tried all the possible options. But still it is not working. Can somebody help me to identify the issue.
Here is my grid creation code:
$("#ptSPSDataGrid").jqGrid({
datatype: 'local',
data: localdata,
colModel: colmod,
rowNum: 10,
rowList: [10, 25, 50],
pager: '#ptSPSPager',
page: 1,
gridview: true,
rownumbers: false,
viewrecords: true,
altRows: true,
loadtext: "Loading parts data...",
caption: 'Part Data',
width: 713,
shrinkToFit: false,
scrollOffset: 0,
height: '100%',
loadComplete: function() {
$("#ptSPSDataGrid").trigger("reloadGrid"); // Call to fix client-side sorting
}
});
$("#ptSPSDataGrid").jqGrid('navGrid', '#ptSPSPager', { add: false, edit: false, del: false, search: false, refresh: false });
$("#ptSPSDataGrid").jqGrid('navButtonAdd', '#ptSPSPager', {
caption: "Show/Hide Columns",
title: "Click here to select the columns to view",
onClickButton: function () { //Adding some code
},
position: "last"
});
I think the problem is in the lines
The event
reloadGridreset thepageparameter to1if you not explicitly set additional parameter (see the answer).What you probably want to do is to trigger reload only once. So you can change the code to something like