vue-jstree icon indicating copy to clipboard operation
vue-jstree copied to clipboard

Get all selected nodes

Open khanhnam99 opened this issue 5 years ago • 2 comments

how Get all selected nodes ?

khanhnam99 avatar Dec 19 '19 10:12 khanhnam99

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 :)

nevzatselcuk avatar Jan 04 '20 07:01 nevzatselcuk

thanks

khanhnam99 avatar Jan 16 '20 04:01 khanhnam99