jqGrid Refreshing Local Data (JSON Object)

前端 未结 6 1733
走了就别回头了
走了就别回头了 2021-01-31 18:44

I\'m trying to use jqGrid with local data and I\'m finding a couple of issues:

I\'m initializing the thing like so:

function refreshGrid($grid, results)
         


        
6条回答
  •  臣服心动
    2021-01-31 19:03

    I was able to achieve something similar. The trick for my issue was to clear out the data before updating the data grid parameter. Assuming your grid is initialized elsewhere (with datatype: 'local'), try:

    function refreshGrid($grid, results) {
        $grid.jqGrid('clearGridData')
            .jqGrid('setGridParam', { data: results })
            .trigger('reloadGrid', [{ page: 1}]);
    }
    

提交回复
热议问题