事件发生后更改treepanel的存储

时间:2014-06-09 15:30:40

标签: extjs treeview

我一直坚持改变Extjs TreePanel的存储,在一些特定事件后我从服务器检索了这些值:

  "{"listType":false,"text":"root","children":[{"listType":false,"text":"Window","children":[{"listType":false,"text":"Window","children":[{"listType":false,"text":"height","children":[],"leaf":true},{"listType":false,"text":"items","children":[{"listType":false,"text":"border","children":[],"leaf":true},{"listType":false,"text":"store","children":[],"leaf":true},{"listType":true,"text":"columns","children":[],"leaf":false},{"listType":false,"text":"xtype","children":[],"leaf":true}],"leaf":false},{"listType":false,"text":"layout","children":[],"leaf":true},{"listType":false,"text":"title","children":[],"leaf":true},{"listType":false,"text":"width","children":[],"leaf":true}],"leaf":false}],"leaf":false}],"leaf":false}"

我想要更新Treepanel的商店,这可能吗?

1 个答案:

答案 0 :(得分:1)

您无需更改商店,只需要新数据即可。这种东西:

var root = treePanel.getRootNode();
root.removeAll();
root.appendChild(objectOrArrayWithChildren);