jQuery 重新加载完成时的jqgrid事件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3534310/
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 15:36:28  来源:igfitidea点击:

jqgrid event when reload is finished?

jqueryjqgrid

提问by JD Isaacks

I am using a jqgrid.

我正在使用 jqgrid。

I can see how many rows I have like this:

我可以看到我有多少行是这样的:

$("#grid").getGridParam("records"));

I can reload some different data like this:

我可以像这样重新加载一些不同的数据:

$('#grid').trigger("reloadGrid");

But once I trigger the reload how do I know when it is done loading and ready for me to see how many rows it has returned?

但是一旦我触发重新加载,我怎么知道它何时完成加载并准备好让我查看它返回了多少行?

回答by Oleg

Reload of jqGrid produce the same events as the grid load. So you can use the for example loadCompletewhich are the last event which execution after the grid loading (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:events#execution_order). So the code could be

jqGrid 的重新加载产生与网格加载相同的事件。因此,您可以使用例如loadComplete在网格加载后执行的最后一个事件(请参阅http://www.trirand.com/jqgridwiki/doku.php?id=wiki:events#execution_order)。所以代码可以是

$("#grid").jqGrid({
    // different parameters
    loadComplete: function(data) {
        alert ("records="+$("#grid").getGridParam("records"));
    },
    // different parameters
});

回答by Craig Stuntz

Handle the gridCompleteevent.

处理gridComplete事件。