jqgrid reload grid partially working

前端 未结 3 548
耶瑟儿~
耶瑟儿~ 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:17

    Try to replace

    $("#list2")[0].refreshIndex();
    $("#list2").trigger("reloadGrid");
    

    with

    var g = $("#list2");
    g.setGridParam({ data: gridData });
    g[0].refreshIndex();
    g.trigger("reloadGrid");
    

    see http://www.trirand.com/blog/?page_id=393/help/losing-edited-cell-data-after-paging/ and http://www.trirand.com/blog/?page_id=393/bugs/data-parameter-are-not-modified-during-inline-editing/ for details.

    In general you should use probably better set url parameter with respect of setGridParam methods or just use postData with a function (see How to filter the jqGrid data NOT using the built in search/filter box for details)

提交回复
热议问题