var store = Ext.create('Ext.data.TreeStore', {
model: 'Demo',
proxy: {
type: 'ajax',
url: 'tree.json' //后台json
},
});
前台说白了和后台没多大关系,它只需要 一串json数组(或者xml),不管你用的什么后台。
自定义tStore绑定值后,
通过tStore.tree.root.childNodes可以取出最外层节点数据,在childNodes取出子节点。
给出例子如下:
$.each(tStore.tree.root.childNodes,function(i,it){
$.each(it.childNodes,function(index,item){
if(item.data.text==text){
ftext = item.data.text;
}
});
});
取tree的store