开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜