jquery - Pagination stops after JQGrid Reload and setting custom page number? -


i new jqgrid , problem jqgrid pagination stops after grid reload. highlighting selected row , maintaining grid page based on given id.

for eg : if select row id 45 on page 4 of jqgrid , page redirected again , selecting same highlighted row , maintaining page 4 .

problem when click pager-previous button goes page 3 not page 2, page 1. same case pager-forward button, goes page 5 not further.

my jqgrid code below-

function bindgroupgrid() {      $("#grouplistgrid").armcustomgrid(    {         url: '../masterdata/getallgroup',        sortname: 'groupname',        sortorder: 'asc',        colnames: ['id', 'entity type', 'group name', 'group description', 'is company', 'edit'],        colmodel: [            { name: 'id', key: true, hidden: true },            {                name: 'entityname', width: 100, align: 'left', index: 'entityname', searchoptions: { sopt: ['cn'] }, resizable: false            },            {                name: 'groupname', width: 100, align: 'left', index: 'groupname', searchoptions: { sopt: ['cn'] }, resizable: false            },            {                name: 'description', width: 120, align: 'left', index: 'description', searchoptions: { sopt: ['cn'] }, resizable: false            },            {                name: 'iscompany', index: 'iscompany', align: 'left', width: 60, sortable: false,                formatter: checkboxformatter, resizable: false, stype: "select",                searchoptions: { value: ":all;true:company;false:individual" }, editoptions: { value: "true:false" }            },            {                name: 'edit', width: 60, index: 'edit', align: 'center', sortable: false, search: false,                formatter: actionformatteredit            }        ],        rownum: 5,        autowidth: true,        loadonce:true,        gridcomplete: function () {            var id = parseint($("#groupid").val());            if (id != null && id != 0) {                $("#grouplistgrid").trigger("reloadgrid", [{ current: true, page: selectedpage }]).setselection(id, true);            }            else {             }        }    });       function actionformatteredit(cellvalue, options, rowobject) {         var page = $('#grouplistgrid').getgridparam('page');         return '<a href="../masterdata/editgroup?groupid=' + options.rowid + '&pagenum=' + page + '" class="editicon"></a>';      }     function checkboxformatter(cellvalue, options, rowobject) {         if (cellvalue === true) return "company"; else return "individual";     }    }  


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -