0

Trying to achieve a simple thing with angular-tree-component - the component is so great that I bet it is something obvious that I am overlooking in the API.

I want to programmatically reveal a node, ie. expanding all its ancestors.

const node = this.tree.treeModel.getNodeById(+id);
if (node) {
  this.tree.treeModel.setFocusedNode(node);
  // now what? :)
}

Neither of the drill methods work for me, setFocusedNode does not reveal the node, it just marks it focused. Help anyone?

2
  • I've looked also in the API and only found expandAll on TreeLevel, but no expand for a node. Perhaps a Feature Request is necessary for that. Commented Aug 8, 2017 at 10:30
  • Nope :) node.setActiveAndVisible(); does the job Commented Aug 8, 2017 at 12:00

1 Answer 1

1

I knew it had to be available, it was just hidden in examples node.setActiveAndVisible();

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.