Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programatically set focused node #36

Closed
muzicaed opened this issue Apr 12, 2023 · 1 comment
Closed

Programatically set focused node #36

muzicaed opened this issue Apr 12, 2023 · 1 comment

Comments

@muzicaed
Copy link

Hi!

Thanks for a really nice library!
I have a use case that I think is not covered with the current implementation.

I use this component to display a folder structure in my project. The idea is that the user should use the tree to select a parent for an item. This works perfectly when creating a new item by using the node-focus event to see what node was selected.

But, when the user wants to edit an item in my application, I see no way to programatically select a node in the tree. Ie. I have the selected id from database and I want to display the tree with that particular node pre-selected in the tree.

Im not sure if there currently is a way to do this that Im not seeing or if this might be a missing feature?

@muzicaed
Copy link
Author

I found a way using the check boxes. When checking a box I just programatically unchecked last checked and thereby forcing a "singel selection". This was actually better, as the focus was removed when eg. clicking on another field etc.

@N00ts N00ts closed this as completed Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants