jQuery 方法“clearGridData”不清除分页工具栏

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4662337/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 17:40:11  来源:igfitidea点击:

The method "clearGridData" does not clear the paging toolbar

jqueryjqgrid

提问by andres descalzo

I'm using the method "clearGridData" of "jqGrid 3.8 " to clear all data, but not clearing the "Navigation layer".

我正在使用“jqGrid 3.8”的“clearGridData”方法清除所有数据,但不清除“导航层”。

$("#MyGrid").jqGrid("clearGridData", true);

Thoroughly clean the grid, but leaves the "Navigation layer":

彻底清理网格,但留下“导航层”:

alt text

替代文字

update

更新

change "paging toolbar" by "Navigation layer"

通过“导航层”更改“分页工具栏”

回答by Cesar

Use $("#MyGrid").jqGrid("clearGridData", true).trigger("reloadGrid");

$("#MyGrid").jqGrid("clearGridData", true).trigger("reloadGrid");

回答by Oleg

The rowNumparameter is not the part of datasent to the server or filled manually. If you show the empty grid having no data the user are able to switch the value of rowNumany time.

rowNum参数不是发送到服务器或手动填写的数据部分。如果您显示没有数据的空网格,用户可以随时切换值rowNum

If you need to reset the rowNumparameter you can use

如果您需要重置rowNum参数,您可以使用

$("#MyGrid").jqGrid('setGridParam', {rowNum:10});

together with the call $("#MyGrid").jqGrid("clearGridData", true);

与电话一起 $("#MyGrid").jqGrid("clearGridData", true);