jqgrid reload grid partially working

前端 未结 3 545
耶瑟儿~
耶瑟儿~ 2020-12-11 12:13

I have a client side managed jqgrid that I reload when some external event are fired. Everything is fine when I reload the grid with more data but when I reload it with less

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-11 12:41

    I Solved this issue using this code but in my case issue was a bit different that newly added rows were not shown in JQGrid. So this code gets the updated data for Grid and then save it in local object and then reassign this local object to grid and reload grid to page 1.

    var grid_data = $("#Grid_ID").jqGrid('getGridParam', 'data'); 
        $("#Grid_ID").jqGrid('clearGridData').jqGrid('setGridParam', { 
            datatype: 'local',
            data: grid_data,
            rowNum: grid_data.length 
        }).trigger('reloadGrid', [{ page: 1}]);
    

提交回复
热议问题