Back long ago with a ultrawebgrid we use to call
var grid = igtbl_getGridById(gsGridName);
grid.Rows.refresh();
this would make everything work great.
After reading a few posts here, it looks like the recommended way of refreshing a grid from javascript is to use an ajax updatepanel with a button in it. For test purposes I just click the button. Great, the grid is refreshed. The problem is that I do not see the ajax refresh image while it reloads.
Am I doing this correctly?
Hello mland ,
Since the grid won’t be the one invoking the update its ajax indicator won’t show. You can however manipulate when it shows and hides manually.
Here are the steps you need to take:
1.Handle the button's onClientClick event and in it get the instance of the ajax indicator and show it with:
wdg.get_ajaxIndicator().show(wdg);
2. Use Sys.WebForms.PageRequestManager to hook a method to handle events after the asynchronous postback has finished.( For more information on this refer to: http://msdn.microsoft.com/en-us/library/bb311028.aspx .)For example:
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(pageReloaded);
And in that method hide the ajax indicator:
function pageReloaded() {
var wdg1 = $find("WebDataGrid1");
wdg1.get_ajaxIndicator().hide();
}
Let me know if you have any questions or concerns regarding this.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
Since the grid won’t be the one invoking the update its ajax indicator won’t show.
Is there a way to get the grid to invoke the update? I like the ultragrid way of updating, is there something similar I can do with WHDG?
Hello mland,
Currently there is no similar method for the grid to invoke it’s refresh.
If you need to refresh the data only for example if you’ve made some changes to it and want to commit it you can call the commit method that will trigger an ajax call to the server to update the data and retrieve the new one. The call would look like this: grid.get_behaviors().get_editiongCore().commit().
Otherwise the approach with the update panel would be the recommended one.
Let me know if you have any further questions regarding this.