PDA

View Full Version : Restart an Ext.TaskMgr



follivier
29 Dec 2010, 2:45 AM
Hello,

I'm trying to stop an restart a task in a switch function.

The first start works, as the stop, but it doesn't start again when it has been stop.


var G_SWITCH_ACTIF_VIEW = 'view1';
var myTask=
{
run: function()
{
// Do something
},
interval: 500
};

function F_startStop()
{
switch (G_SWITCH_ACTIF_VIEW)
{
case 'view1':
Ext.TaskMgr.start(myTask);
G_SWITCH_ACTIF_VIEW = 'view2';
break;
default: // 'view2'
Ext.TaskMgr.stop(myTask);
G_SWITCH_ACTIF_VIEW = 'view1';
break;
}
}



Any advise?

Thank you

mankz
31 Dec 2010, 12:26 AM
Works for me in both FF/IE....

follivier
31 Dec 2010, 1:23 AM
I've post a simple view to describe the behavior of my application.

When I debug my code with Firebug for example, it doesn't go in the run method when you restart the task.

I have try with a really simple reduced code (start and stop button) and it's the same.