nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / jqTree / static / examples / multiple_select.js
1 $(function() {
2     var $tree = $('#tree1');
3     $tree.tree({
4         data: ExampleData.example_data,
5         autoOpen: true
6     });
7     $tree.bind(
8         'tree.click',
9         function(e) {
10             // Disable single selection
11             e.preventDefault();
12
13             var selected_node = e.node;
14
15             if (selected_node.id == undefined) {
16                 console.log('The multiple selection functions require that nodes have an id');
17             }
18
19             if ($tree.tree('isNodeSelected', selected_node)) {
20                 $tree.tree('removeFromSelection', selected_node);
21             }
22             else {
23                 $tree.tree('addToSelection', selected_node);
24             }
25         }
26     );
27 });