Extjs4 如何将数据加载到树存储中。数据来自另一个树存储的读取器
我有两个树面板,每个配置有单独的树存储。我已为一个存储配置了代理。在加载事件时,我尝试加载第二个storeproxy内存,如下所示。但它不起作用 EXT js版本:4.0.7Extjs4 如何将数据加载到树存储中。数据来自另一个树存储的读取器,extjs4,Extjs4,我有两个树面板,每个配置有单独的树存储。我已为一个存储配置了代理。在加载事件时,我尝试加载第二个storeproxy内存,如下所示。但它不起作用 EXT js版本:4.0.7 _treeStore2 = Ext.create('Ext.data.TreeStore', { model: 'Scenario', proxy : { type : 'memory' } }); _treeStore1 = Ext.create(
_treeStore2 = Ext.create('Ext.data.TreeStore', {
model: 'Scenario',
proxy : {
type : 'memory'
}
});
_treeStore1 = Ext.create('Ext.data.TreeStore', {
model: 'Scenario',
root:'data1',
proxy : {
type : 'ajax',
url: '/proj/examples?id='+_Id,
reader : {
type : 'json',
root:'data1'
}
},
listeners: {
'load': {
fn: function(store, records, success, operations) {
_treeStore2.setRootNode(_treeStore1.getProxy().getReader().jsonData.data2);
}
}
});
示例JSON数据:
{"data1":[{"name":"value","children":[]}],"data2":[{"name":"value","children":[]}]}
尝试使用LoadData2或loadRawData方法。
谢谢dbrin我尝试过这个方法,但没有解决说loadRawData不是TreeStore中的函数。