jqGrid paging question

后端 未结 1 706
北恋
北恋 2020-11-22 11:45

If you have 17 records and are displaying 15 at a time then when you\'re on page 2 you see records 16-17 of 17 - makes sense.

Now when you\'re on this second page an

1条回答
  •  囚心锁ツ
    2020-11-22 12:02

    You are right. It is an old problem. I used always before

    $("#list").setGridParam({page:1}).trigger('reloadGrid');
    

    but there is another way. The trigger 'reloadGrid' support additional options: 'current' and 'page'.

    $("#list").trigger("reloadGrid", [{page:1}]);
    

    will reset page to 1 in one step. The usage in the form

    $("#list").trigger("reloadGrid", [{current:true}]);
    

    allows to preserver current selection. You can of cause combine both options.

    0 讨论(0)
提交回复
热议问题