:: Forum >>

Add onrefresh event to new version

Could you add the onrefresh method to the new version of the datagrid? I find it very useful in event based programming. Below is the code change I did to aw.js, perhaps everyone can benefit from this.

obj.refresh=function(){
try{var element=this.element();
if(element){
AW.setOuterHTML(element,this.toString());
if (typeof(this.clone().onrefresh)=="function") this.clone().onrefresh();
}}catch(error){this.handle(error)}};


Its useful when you want to perform an operation on the grid and you want to do it after the grid has come to a stable state. Say for instance you implement a search feature but the contents of the grid are not yet populated because your ajax command has not yet returned the data. So when ajax returns the data and you bind it to the grid, you programmatically assign onrefresh a handler which finds the underlying record (by ID or whatever format your data is in) and highlights the row/record showing you its been found.

Please and thank you.
Phil Carrillo
Friday, October 31, 2008
Actually this is already in the latest version (see /source/lib/grid/control.js lines 608, 617)

obj.refresh = function(){
    ...
    this.raiseEvent("onControlRefreshing");
    _super.refresh.call(this);
    ...
    this.raiseEvent("onControlRefreshed");
};
Alex (ActiveWidgets)
Monday, November 10, 2008

This topic is archived.


Back to support forum

Forum search