extjs4 - How to call an application function from a controller?
Given an applica开发者_高级运维tion:
Ext.application({
name: 'APP',
appFolder: 'app',
funcA: function() {
console.log('called funcA');
},
launch: function() {
...
var funcB = function() {
console.log('called funcB');
}
...
}
});
My controller can call this.application.funcA() but not funcB() within the launch method. How can I call funcB() externally?
You can't, as funcB is private to your launch callback, You can move it outside of the callback, just like you did funcA
. Basically anything defined inside of a function is private to that function.
精彩评论