ezraroi / ngJsTree

Angular Directive for the famous JS Tree
http://ezraroi.github.io/ngJsTree/
MIT License
270 stars 98 forks source link

Checkbox Plugin - How to get clicked node #51

Closed urgupluoglu closed 8 years ago

urgupluoglu commented 8 years ago

Hi Roi,

I'm trying to show a unique description text when a checkbox is clicked. Here is how to get all newly selected ones (from jstree api): https://www.jstree.com/plugins/ [Changed Plugin] First, I'm trying to achieve this by having different syntax, but no luck;

var selected_nodes = $scope.treeInstance.jstree('changed');
var selected_nodes = $scope.treeInstance.jstree(true).changed(true);
var selected_nodes = $scope.treeInstance.jstree(true).get_selected('changed');
var selected_nodes = $scope.treeInstance.jstree(true).get_selected(true).changed(true);

Can you tell me how I can get only the newly selected nodes?

The second problem is auto-select. When It auto selects a parent or a child node, it also comes in changed array. So is there a way in angular directive you coded to get clicked node only?

Thanks.

ezraroi commented 8 years ago

Hi, I think this is something you should ask in the jsTree page, this directive only wraps it and gives it 2 way binding for angular.

sorry

ayoub-alikkane commented 6 years ago

if (config.plugins) { config.plugins.push('checkbox'); } else { config.plugins = ['checkbox']; }

replace alltrigger with checkbox as mentionned above, inside ngJsTree file