我正在尝试创建一个没有模型的简单TreeStore,这就是我所做的:
var store = new Ext.data.TreeStore({
fields: ['name', 'area', 'children'],
data: {
name: 'Budget',
area: 1,
children: [{
name: 'Defense',
area: 0.5,
children: []
}, {
name: 'Education',
area: 0.3,
children: []
}, {
name: 'Debt',
area: 0.2,
children: []
}]
}
});
但是我得到Uncaught TypeError: Cannot call method 'getReader' of undefined
,有人可以告诉我我错过了什么吗?
由于
答案 0 :(得分:1)
您需要指定使用内存代理:
var store = new Ext.data.TreeStore({
fields: ['name', 'area', 'children'],
data: {
text: 'Budget',
area: 1,
children: [{
name: 'Defense',
area: 0.5,
children: []
}, {
name: 'Education',
area: 0.3,
children: []
}, {
name: 'Debt',
area: 0.2,
children: []
}]
},
proxy : 'memory'
});