PDA

View Full Version : Passing args to TaskMgr



defcon1
22 Jun 2011, 11:56 AM
Hi,

with the argument "args" I can pass optional arguments to the task, but how can I access them inside the task? :((

Many thanks
d1

skirtle
23 Jun 2011, 5:41 PM
They're passed as arguments to your run() function.

defcon1
23 Jun 2011, 10:56 PM
I know about that, but how can I access them inside my run-function? They donīt seem to get applied to the this-context ...

skirtle
24 Jun 2011, 12:05 AM
I know about that, but how can I access them inside my run-function?


They're passed as arguments to your run() function.


Ext.TaskMgr.start({
args: ['March', '2009'],
interval: 1000,

run: function(month, year) {
console.log(month); // logs out 'March'
console.log(year); // logs out '2009'
}
});

defcon1
24 Jun 2011, 12:54 AM
Cool, thanks! ;)