问题
Please consider the situation:
- I'm using Extjs'
tree.Panelto have some sort of navigation on a page. - I have a list of items in another portion of the page, whose list items have a unique id that matches the
internalIdof a node in the tree. - I wish to bind a click for each list item and expand the tree to the node specified by the id on the item.
I intend to use the expandPath(path) method from the tree. My question would be: how can I get the path string with just the internalId? Thank you.
回答1:
Unfortunately function NodeInterface.getPath was vanished from extjs4. So there is no way to use expandPath(path). But, instead, you can use
tree.store.getNodeById('ext-record-23').bubble(function(node){node.expand()});
来源:https://stackoverflow.com/questions/6709106/expand-a-tree-path-by-sending-the-internalid-as-parameter