How to show all rows in the jqGrid?

后端 未结 14 1658
心在旅途
心在旅途 2020-12-02 22:26

jqGrid exposes a property rowNum where you can set the number of rows to display for each page. How do you set the grid to just display ALL rows?

Right

14条回答
  •  猫巷女王i
    2020-12-02 22:56

    I've got this working:

    $('#bla').jqGrid({
            ...
            'rowNum'      : 0,
            'loadOnce'    : true,
            'loadComplete': function(data) {
                $(this).jqGrid('setGridParam', 'rowNum', data.total);
            },
            ...
    });
    

    This works with and without the loadOnce option set to true. Note that you have to set the rowNum option to 0 first, if you leave out this option it'll still default to the 20 records to show. Also, I'm assuming you're returning the total rows from the server in the documented JSON reader format.

提交回复
热议问题