Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQgrid on refresh button click

Tags:

refresh

jqgrid

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

like image 466
hetal gala Avatar asked Apr 26 '12 04:04

hetal gala


People also ask

How to add Refresh icon in footer of jqgrid table?

Refresh is used reload jQgrid table data, sometimes table is not refresh on action that time you need to refresh table data manually. jQgrid provide refresh: true property that enable to add refresh icon into footer of jQgrid table.You need to add this property into pager jqgrid instance.

How to delete all the posted data in jqgrid?

here you will get all your posted data in console.log (). Delete record is another common functionality in grid listing.You need to add delete call-back function into jQgrid instance and pass parameters like delete window header, send request on ENTER button clicked etc. //delete Options. save key parameter will keybind the Enter key to submit.

How to add add edit and delete button in jqgrid table?

first we will add a New record, Edit and Delete button into jQgrid table, we need to add 'true' property of add, edit, delete option which are associated with jQgrid instance, Change false to true property that will show add,edit and delete button into footer of jQgrid table, after required changes the previous code will become like below,

Is there any advanced option available in jqgrid plugin?

There are a lot of advanced option available in jQgrid plugin, you can explore more jQgrid features as per you requirement. You can download source code and Demo from below link. Please support us, use one of the buttons below to unlock the content.


1 Answers

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!');
     }
});
like image 68
Oleg Avatar answered Sep 18 '22 12:09

Oleg