How to refresh the data in a jqGrid?

Earlz picture Earlz · Jun 28, 2010 · Viewed 99.8k times · Source

I have been trying to get a grid to be updated from the datasource when a button is pushed.

So I have in the click event something like this:

$('#grid').jqGrid('trigger','reloadGrid');

However this does not work and I get an error thrown for unknown method 'trigger'

I have also tried

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

How would I execute this function?

Answer

Peter Bailey picture Peter Bailey · Jun 28, 2010
$('#grid').trigger( 'reloadGrid' );