PDA

View Full Version : Scope for Direct handler



makcs
27 Dec 2009, 1:25 AM
Help me please. I need the scope in direct handler function :-/

Simple, i requested server function. How i can send my scope to it?

TestAction.doEcho( message, function(){
console.log(this);
});

if i make so TestAction.doEcho( message, function(){ ... }.call(this)); request error...

Bad style handler call by id
TestAction.doEcho( message, function(){
var myCmp = Ext.getCmp( 'myCmpID' );
});


Sorry for my bad english... :">

makcs
27 Dec 2009, 1:49 AM
:D
TestAction.doEcho( 'Hello world!', _directHandler.createDelegate(this) );

elishnevsky
27 Dec 2009, 8:54 AM
TestAction.doEcho(message, function(){
console.log(this);
}, this);