Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jqgrid event when reload is finished?

Tags:

jquery

jqgrid

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?

like image 527
JD Isaacks Avatar asked Aug 20 '10 19:08

JD Isaacks


2 Answers

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
});
like image 112
Oleg Avatar answered Nov 10 '22 23:11

Oleg


Handle the gridComplete event.

like image 31
Craig Stuntz Avatar answered Nov 10 '22 23:11

Craig Stuntz