question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possibility to select one node from the id.

See original GitHub issue

Would be good to have the possibility to select an node by the id. I did not find this possibility in the API. In this case should fire an event informing that the node has been selected.

One great tree component that i use is the jsTree (https://www.jstree.com) but it has the disadvantage of use jquery.

Follow my suggestion: <Tree #tree [nodes]="nodes"></Tree> <button (click)="tree.treeModel.selectNode(2)">next node</button> nodes = [ { id: 1, name: ‘root1’, isExpanded: true, children: [ { id: 2, name: ‘child1’ }, { id: 3, name: ‘child2’ } ] } ]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:19 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Aug 2, 2016

I intend to solve this by adding locators on the tree according to id / path. Also, need an “ensureVisible” method that expands and scrolls to it.

So will be able to do: node = tree.findNodeById(id) or node = tree.findNodeByPath([‘parent’, ‘child’, ‘leaf’])

and then: node.toggleActivated(); node.ensureVisible();

What do you think?

On Tue, Aug 2, 2016 at 12:18 PM, Gillardo notifications@github.com wrote:

I am also looking for this functionality, this would be a great addition to have.

I have a list of folders that are being displayed in the treeview, i would like to select the folder by id, and the treeview should automatically be expanded to that node, with that node selected.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/500tech/angular2-tree-component/issues/22#issuecomment-236850042, or mute the thread https://github.com/notifications/unsubscribe-auth/ACUsQzcOdK5yWxoCSJkKq4VLUs9LVf3Kks5qbwtlgaJpZM4JYtrH .

Adam Klein CTO & Co-Founder Tel. +972-52-747-5633 blog.500tech.com http://blog.500tech.com meetup.com/angularjs-il

0reactions
adamkleingitcommented, Aug 11, 2016

I’m closing this issue though

Read more comments on GitHub >

github_iconTop Results From Across the Web

Possibility to select one node from the id. · Issue #22 - GitHub
I have a list of folders that are being displayed in the treeview, i would like to select the folder by id, and...
Read more >
Is it possible to select node or element by ID? - FunctionBay
To select nodes or elements, you need to select the 'Select Node' option or 'Select Element' option from the toolbar on the left...
Read more >
jquery - How to select only one node in jstree when multiple ...
First I am searching nodes and getting all ID of searched nodes. Now I have "next" button where on click I have to...
Read more >
Programmatically select node by it's id - Vue - Syncfusion
Is it possible to select a node programmatically through it's id? For example i want to select the node with id 4. Single...
Read more >
Can I highlight a node or an element by its ID to locate it in the ...
In Worksheet, you have option to select a node or an element based ... To select the mesh by ID go to Selection...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found