我的 Treepanel 有 id 'treePanel' 并且工作得很好。
示例路径:
/subfolder3/abc
expandAll()
使用树面板扩展所有内容但expandPath()
不起作用。
现在,在某些事件之后,我想在我的树中扩展一条路径。但是我做不到。
到目前为止,我已经尝试过:
var oTreePanel = Ext.getCmp('treePanel');
oTreePanel.expandPath('/subfolder3/abc'); // or '/subfolder3' or '/root/subfolder3'
没有错误消息,但树中也没有变化。
该怎么办?
编辑
oTreePanel.selModel.getSelection()[0].getPath()
是/root/
。
我尝试了什么:
path:
/root
=>success
istrue
andnode
说node.data.id=""
andnode.data.path=""
path:
/root/
=>success
istrue
andnode
表示node.data.id=""
andnode.data.path="/report_with_variables"
(树中的第一个节点) andnode.data.parentId= "root"
path:
/root/subfolder3
to the path :success
isfalse
andnode
saynode.data.id=""
andnode.data.path=""
isnode.getPath()
/root
我对树的 Json 响应如下所示:
{"status":{"status":0,"msg":"Ok","protocolversion":"extjs.json"},"value":{"name":"","path":"\/","type":"folder","leaf":false,"children":[{"name":"report_with_variables","path":"\/report_with_variables","type":"report","leaf":true,"title":"Report ohne Variablen","description":null},{"name":"subfolder1","path":"\/subfolder1","type":"folder","leaf":false},{"name":"subfolder2","path":"\/subfolder2","type":"folder","leaf":false},{"name":"subfolder3","path":"\/subfolder3","type":"folder","leaf":false},{"name":"testreports","path":"\/testreports","type":"folder","leaf":false}]}}