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
The method "clearGridData" does not clear the paging toolbar
提问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":
彻底清理网格,但留下“导航层”:
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 rowNum
parameter 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 rowNum
any time.
该rowNum
参数不是发送到服务器或手动填写的数据部分。如果您显示没有数据的空网格,用户可以随时切换值rowNum
。
If you need to reset the rowNum
parameter you can use
如果您需要重置rowNum
参数,您可以使用
$("#MyGrid").jqGrid('setGridParam', {rowNum:10});
together with the call $("#MyGrid").jqGrid("clearGridData", true);
与电话一起 $("#MyGrid").jqGrid("clearGridData", true);