Pagination problem in jqgrid with array data

前端 未结 2 1988
深忆病人
深忆病人 2020-12-07 03:44

I am facing problem with pagination in jqgrid with array data having 18 records, but the records are not displaying in pages even I specified pagination:true,pager:jQuery(\'

2条回答
  •  渐次进展
    2020-12-07 03:47

    Oleg is correct. Adding jQuery("#list4").setGridParam({ rowNum: 10 }).trigger("reloadGrid"); works.

    Although it might not work if formatter property is set where the rowObject values will be undefined.(if they are used)

    Therefore make sure in your formatter method u always check for their availability.

    e.g.

    function getFormattedFileName(cellvalue, options, rowObject) {
    
            if(!rowObject.fileName) {// this is due to ...trigger("reloadGrid");
                return cellvalue; // the value is already formatted, let's just return it
            }
     return rowObject.fileName.trim();
    }
    

提交回复
热议问题