Get all row IDs in jqGrid

后端 未结 4 486
攒了一身酷
攒了一身酷 2021-01-05 05:47

How can one get the ID\'s of every row in a grid, even across pages?

getDataIDs and getRowData only gives the ID\'s of the current page.

4条回答
  •  借酒劲吻你
    2021-01-05 06:30

    There is another way of getting this data in older versions on jqgrid:

    gRowNum = grid.jqGrid('getGridParam','rowNum');
    
    grid.setGridParam({rowNum: '9999'});
    grid.trigger("reloadGrid");
    myList = grid.jqGrid('getDataIDs');
    
    grid.setGridParam({rowNum: gRowNum});
    grid.trigger("reloadGrid");
    

提交回复
热议问题