我正在迁移 ext js 4 to ext js 5.1
。我的 extjs 4.2.1 中有代码,升级到 extjs 5.1 后出现控制台错误。它在 ExtJs 4.2.1 中运行良好,不知道为什么会这样给出错误,说
未捕获的错误:[Ext.create] 无法识别的类名/别名:MyApp.store.LibraryFolderTreeStore
Ext.define('MyApp.view.library.LibraryTreeView', {
extend : 'Ext.tree.Panel',
alias : 'widget.librarytreeview',
requires: [
'MyApp.store.LibraryFolderTreeStore'
],
store : Ext.create("MyApp.store.LibraryFolderTreeStore") // getting error on this line
....
});
You cannot use
Ext.Create
while defining class.You have to use
initComponent
method in which you can assign config usingExt.Create
.