iceberg
29 Oct 2007, 1:26 PM
hi,
i built a grid that autorefreshes its data every n minutes
this is the code how i did it (i used code that was found in the forum)
Ext.override(Ext.data.Store, {
startAutoRefresh : function(interval, params, callback, refreshNow){
if(refreshNow){
this.load({params:params, callback:callback});
}
if(this.autoRefreshProcId){
clearInterval(this.autoRefreshProcId);
}
this.autoRefreshProcId = setInterval(this.load.createDelegate(this, [{params:params, callback:callback}]), interval*1000);
}
});
the grid refreshes nicely
the problem starts when i switch to another page (that doesn't even have a grid) i can see in firebug that the grid's data fetching continues to be called.
if i go to a page with another grid, now i get that both of the grids autorefresh and it continues even if i leave the page
i tried to add at the main page the following code
Ext.enableGarbageCollector=true;
Ext.enableListenerCollection=true;
it doesn't seem to work.
any ideas how to solve it ??????
i built a grid that autorefreshes its data every n minutes
this is the code how i did it (i used code that was found in the forum)
Ext.override(Ext.data.Store, {
startAutoRefresh : function(interval, params, callback, refreshNow){
if(refreshNow){
this.load({params:params, callback:callback});
}
if(this.autoRefreshProcId){
clearInterval(this.autoRefreshProcId);
}
this.autoRefreshProcId = setInterval(this.load.createDelegate(this, [{params:params, callback:callback}]), interval*1000);
}
});
the grid refreshes nicely
the problem starts when i switch to another page (that doesn't even have a grid) i can see in firebug that the grid's data fetching continues to be called.
if i go to a page with another grid, now i get that both of the grids autorefresh and it continues even if i leave the page
i tried to add at the main page the following code
Ext.enableGarbageCollector=true;
Ext.enableListenerCollection=true;
it doesn't seem to work.
any ideas how to solve it ??????