1
内调用ExtJS的类方法,当我尝试下面执行的代码,我得到两个Uncaught ReferenceError
消息无法从类
Ext.define('Example.foo', {
store: _createStore(),
_createStore: function() {
return new Ext.data.JsonStore({...});
}
});
var example = new Example.foo();
错误消息:
Uncaught ReferenceError: _createStore is not defined
Uncaught ReferenceError: Example is not defined
仍然出现错误如果_createStore
被定义为高于store
。我正在使用ExtJS 4.2.1.883。
真棒,从'initComponent'调用它就是我需要的。一些谷歌搜索引导我[这个SO帖子](http://stackoverflow.com/questions/14492179/to-initcomponent-or-not-to-initcomponent),解释了为什么它的工作。 – anjunatl