I have a component that fires an onFocus event. I am assigning a class method to handle the onFocus event. In the event handler I need access to both the class instance, and the event object itself.
However, when I use .bind(this), I can no longer get the event object because the scope is now changed to the class instance. And if I don't use .bind(this) I can access the event object, but not the class instance.
I'm sure there is a solution, but I have not been able to figure this out. Any ideas?
Thanks.
new Class( {
handleComponentFocus : function() {
// this refers to the class instance
// I would also like to get the event information as well, but can't now that the scope has been changed
}.bind(this)
this.pickList = new BasePickList( {
onFocus : this.handleComponentFocus
});
})