Uncaught TypeError: Cannot read property 'getRootNode' of undefined in ExtJs
Uncaught TypeError: Cannot read property 'getRootNode' of undefined in ExtJs
我正在尝试使用在商店中硬编码的商店数据来形成树检查树,但我无法实现这一点,并且出现以下错误
我是 extjs 的新手,有人知道这个问题吗?
Uncaught TypeError: Cannot read property 'getRootNode' of undefined
Store
Ext.define('my.store.ModuleHomeStore', {
extend: 'Ext.data.TreeStore',
autoLoad : false,
root: {
text:'test Object Tree',
id:'TestTreeStoreId',
expanded: true,
children: [{
"text":"AntiVirus Software",
"id":"46",
"leaf":"false"
},
{
"text":"Appliance",
"id":"68",
"leaf":"false"
}
]
},
folderSort: true,
sorters: [{
property: 'text',
direction: 'ASC'
});
}];
views
Ext.define('my.view.MainTree', {
extend : 'Ext.tab.Panel',
width : 400,
height : 600,
alias : 'widget.MainTreeTest',
name : 'mainTree',
plain: true,
items : [{
xtype: 'pTree',
width:219,
height:700,
bbar: [{
xtype: 'button',
text: 'Cancel'
},{
xtype: 'button',
text: 'Ok'
}]
}]
});
Ext.define('my.view.PreTree', {
extend : 'Ext.tree.Panel',
title: 'MyPreference',
alias : 'widget.pTree',
id : 'preid',
store: 'ModuleHomeStore',
height: 600,
width: 400,
multiSelect: true,
rootVisible : false,
resizable:false,
hideHeaders : true,
sortable : true,
xtype:'check-tree'
});
我正在尝试使用在商店中硬编码的商店数据来形成树检查树,但我无法实现这一点,并且出现以下错误
我是 extjs 的新手,有人知道这个问题吗?
Uncaught TypeError: Cannot read property 'getRootNode' of undefined
Store
Ext.define('my.store.ModuleHomeStore', {
extend: 'Ext.data.TreeStore',
autoLoad : false,
root: {
text:'test Object Tree',
id:'TestTreeStoreId',
expanded: true,
children: [{
"text":"AntiVirus Software",
"id":"46",
"leaf":"false"
},
{
"text":"Appliance",
"id":"68",
"leaf":"false"
}
]
},
folderSort: true,
sorters: [{
property: 'text',
direction: 'ASC'
});
}];
views
Ext.define('my.view.MainTree', {
extend : 'Ext.tab.Panel',
width : 400,
height : 600,
alias : 'widget.MainTreeTest',
name : 'mainTree',
plain: true,
items : [{
xtype: 'pTree',
width:219,
height:700,
bbar: [{
xtype: 'button',
text: 'Cancel'
},{
xtype: 'button',
text: 'Ok'
}]
}]
});
Ext.define('my.view.PreTree', {
extend : 'Ext.tree.Panel',
title: 'MyPreference',
alias : 'widget.pTree',
id : 'preid',
store: 'ModuleHomeStore',
height: 600,
width: 400,
multiSelect: true,
rootVisible : false,
resizable:false,
hideHeaders : true,
sortable : true,
xtype:'check-tree'
});