Reload/Refresh jqGrid

It has been a long time I contribute to the blog post. Well I return with something new from my side. I was working on building the jqGrid which will load the annotation information for an account record. Which seems to be simple and cool wherein I would like to add something like after I add a annotation to the account record I need to view the latest changes in jqGrid of annotation.

So, to achieve this I thought of using the available ‘Reload Grid‘ icon in the jqGrid. But the actual reload grid does not load the jqGrid with new information. Quick workaround seem to be like invoking a custom code on reloading the grid which will bind the jqGrid with latest data.

Code snippet to reload the jqGrid with custom logic is like

jQuery(“#table_annotation”).jqGrid(‘navGrid’, ‘#pager_annotation’,
{
beforeRefresh:function()
{
//custom code to load the jqgrid with new information and bind to the grid

alert(“Hello”);
}

});

Now when you click on Reload icon, your custom logic is invoked and bind the jqGrid with new data. Hope it helps you as well. 🙂

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s