PDA

View Full Version : How to change the scope of a triggerfield?



vocabo
10 Jul 2010, 10:07 AM
Hello, I want to change the scope of a triggerfield. For examples if we have a handler or a button we can change the scope like this:



myCmp.on('myevent', this.myHandler, newScope);

buttons: [{
text: 'Do Something',
handler: this.doSomething,
scope: newScope
}]
Any ideas?

Thanks

Condor
10 Jul 2010, 11:18 AM
onTriggerClick: handler.createDelegate(scope)

vocabo
10 Jul 2010, 12:21 PM
Thanks! This works like a charm.