extjs 4.0中 tree panel怎么新建一个node


你已经懂了啊卖好散
var child=Ext.create('Ext.data.NodeStore', {
text:x[i].getAttributeNode("中氏袜段category").nodeValue,
leaf:false
});
rootNode.appendChild(child);
var root = treeStore.getRootNode(); //得岩嫌到树的根陵卜节点

var child = root.findChild('id',pf.getComponent('c1').getComponent('depart').getValue(),true);//获得需要加入节点的子节点位置

child.appendChild({
id:empID.getValue(),
text:vText,
flag:vFlag,
leaf:true
});//在该子节点下增尺枣穗加节点