我一直坚持改变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的商店,这可能吗?
答案 0 :(得分:1)
您无需更改商店,只需要新数据即可。这种东西:
var root = treePanel.getRootNode();
root.removeAll();
root.appendChild(objectOrArrayWithChildren);