开发者

extjs4 - How to call an application function from a controller?

开发者 https://www.devze.com 2023-04-08 22:13 出处:网络
Given an applica开发者_高级运维tion: Ext.application({ name: \'APP\', appFolder: \'app\', funcA: function() {

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号