Search code examples
javascriptjqgridtriggersevent-handlingeventtrigger

How to execute a function before reloadGrid in jqgrid?


I want to run a function every time the grid reloads.

So How can I achieve that?

I am invoking reloadGrid by this:

jQuery("#myGrid").trigger("reloadGrid");

I have a function

function myFunc()
{
 // Do something
}

I am not getting the reloadGrid event handler. If I get that one, then I can just bind reloadGrid again with the handler call and myFunc() call.


Solution

  • Okay, I solve it by this:

    $('#myGrid').on('reloadGrid', myFunc());