tags:

views:

58

answers:

2

I am using a 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?

+1  A: 

Handle the gridComplete event.

Craig Stuntz
+1  A: 

Reload of jqGrid produce the same events as the grid load. So you can use the for example loadComplete which 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

$("#grid").jqGrid({
    // different parameters
    loadComplete: function(data) {
        alert ("records="+$("#grid").getGridParam("records")));
    },
    // different parameters
});
Oleg
+1 for the link to the list of events! very useful. However, I ended up using the `gridComplete` event so I accepted Craig's answer. I am sure your solution is just as good, but I can only accept one. thanks!
John Isaacks