JQgrid on refresh button click

jqgrid, refresh

Solution

If you need to do some actions before refresh will be started you should use beforeRefresh callback:

$("#grid_id").jqGrid('navGrid', '#gridpager', {
    beforeRefresh: function () {
        // some code here
    }
});

If you need absolute another implementation of grid Refreshing where you will not call `$("#grid_id").trigger("reloadGrid");` (which sound strange) you can do this by the usage of `refresh: false` option to remove the standard Refresh button and using navButtonAdd to add your custom button which looks exactly like the original one:

$("#grid_id").jqGrid('navGrid', '#gridpager', {refresh: false});
$("#grid_id").jqGrid('navButtonAdd', "#gridpager", {
     caption: "", title: "Reload Grid", buttonicon: "ui-icon-refresh",
     onClickButton: function () {
         alert('"Refresh" button is clicked!');
     }
});

Problem

I want to write code on Refresh button click of JQGrid. Is there any event for that?

Original source