Hi,
I am trying to get a DelayedTask function to loop at a set interval using the following code:
Code:
this.delayedRefreshTaskInterval = 5000;
this.delayedRefreshTask = new Ext.util.DelayedTask(function(){
this.raiseEvent('checkforupdates');
this.delayedRefreshTask.delay(this.delayedRefreshTaskInterval);
}, this);
I am defining the above code in my launch function of my application code, not sure this is the correct thing to do actually??
I can kick this off elsewhere in some controller code by doing:
Code:
this.getApplication().delayedRefreshTask.delay(this.getApplication().delayedRefreshTaskInterval);
The 'checkforupdates' call in the function does get fired after 5 seconds, but it doesn't continue to get fired every 5 seconds as I would expect.
Where am I going wrong here please?