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

Get all selected nodes #108

Open
khanhnam99 opened this issue Dec 19, 2019 · 2 comments
Open

Get all selected nodes #108

khanhnam99 opened this issue Dec 19, 2019 · 2 comments

Comments

@khanhnam99
Copy link

how Get all selected nodes ?

@nevzatselcuk
Copy link

I just found a solution somewhere on web like this.
setSelectedItems(){ this.selectedItems = [] this.$refs.tree.handleRecursionNodeChilds(this.$refs.tree, node => { if (typeof node.model!='undefined' && node.model.hasOwnProperty('selected') && node.model.selected) { this.selectedItems.push(node.model.value) } }) }

This is a method on Vue component. My VueJstree components ref is TREE. I put that method in itemSelect method. It gives all selected node values to SELECTEDITEM array. Thats it :)

@khanhnam99
Copy link
Author

thanks

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