[英]ExtJS: Uncaught TypeError: Cannot read property 'scope' of undefined
[英]Extjs5 treepanel [Uncaught TypeError: Cannot read property 'create' of undefined]
我在extjs5中的treepanel有問題。 當我像這樣創建樹面板時:
Ext.syncRequire(['Ext.tree.Panel', 'Ext.form.Label', 'Ext.window.*', 'Ext.data.TreeStore' ]);
var myTreePanel = Ext.create('Ext.tree.Panel', { title: 'Simple Tree', width: 200, height: 150, store: store, rootVisible: false, });
然后在同一文件中,我有:
//Window view:
var treeViewWindow = Ext.create('Ext.window.Window', { items:[myTreePanel] });
Ext.application({ name: 'Training App', launch: function () { treeViewWindow.show(); } });
這行不通,並給我錯誤: Uncaught TypeError: Cannot read property 'create' of undefined
Component.js:5421
Uncaught TypeError: Cannot read property 'create' of undefined
請注意,如果我使用面板更改了樹面板,則它可以工作。 如果我將整個代碼放在午餐函數中(window和treepanel變量),那么它也可以工作!
有人可以幫我從這里出去嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.