hi all, i was happily coding my components the usual way:
PHP Code:
Ext.extend(myComponent, Ext.grid.EditorGridPanel,{
.
.
eventhandler1:function(){},
eventhandler2:function(){},
.
.
.
func1:function(){...},
func2:function(){...},
func3:function(){...}
.
.
.
})
and everything was fine till i decided to organize my codes in this way
PHP Code:
Ext.extend(myComponent, Ext.grid.EditorGridPanel,{
events:{
tbar:{...handlers here...},
grid:{...handlers here...}
editor:{...handlers here...}
},
methods:{
func1:function(){...}
func2:function(){...}
.
.
.
}
})
now in order to call the method i would have to use:
PHP Code:
this.foo=new myComponent({...});
this.foo.methods.func1.call(this.foo,....)
instead of (what i would think it should be)
PHP Code:
this.foo.methods.func1(....)
which runs under the scope of the caller/event raiser
can anyone explain why this is happening an how i can code it such that i can use the latter without the need for specifying scope.
thanks