gpt4 book ai didi

extjs4 - 如何从 Controller 调用应用程序功能?

转载 作者:行者123 更新时间:2023-12-01 10:34:01 26 4
gpt4 key购买 nike

给定一个应用程序:

Ext.application({
name: 'APP',
appFolder: 'app',

funcA: function() {
console.log('called funcA');
},

launch: function() {
...
var funcB = function() {
console.log('called funcB');
}
...
}
});

我的 Controller 可以在启动方法中调用 this.application.funcA() 但不能调用 funcB()。如何从外部调用 funcB()?

最佳答案

你不能,因为 funcB 对你的启动回调是私有(private)的,你可以把它移到回调之外,就像你做 funcA 一样。基本上,函数内部定义的任何内容都是该函数私有(private)的。

关于extjs4 - 如何从 Controller 调用应用程序功能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7589636/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com