You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,11 +107,13 @@ Attributes of angular treecontrol
107
107
-`treecontrol` : the treeview element.
108
108
- element content : the template to evaluate against each node (and the parent scope of the tree) for the node label.
109
109
-`tree-model` : [Node|Array[Node]] the tree data on the `$scope`. This can be an array of nodes or a single node.
110
-
-`selected-node` : [Node] binding for the selected node in the tree. Updating this value updates the selection displayed in the tree. Selecting a node in the tree will update this value.
110
+
-`selected-node` : [Node], used when `multiSelection=false`. Binding for the selected node in the tree. Updating this value updates the selection displayed in the tree. Selecting a node in the tree will update this value.
111
+
-`selected-nodes` : [Array[Node]], used when `multiSelection=true`. Binding for the selected nodes in the tree. Updating this value updates the selection displayed in the tree. Selecting a node in the tree will update this value.
111
112
-`expanded-nodes` : [Array[Node]] binding for the expanded nodes in the tree. Updating this value updates the nodes that are expanded in the tree.
112
-
-`on-selection` : callback called whenever selecting a node in the tree. The callback argument is the selected node.
113
-
-`on-node-toggle` : callback called whenever a node expands or collapses in the tree. The function arguments are the toggled node and a boolean which is true for expansion, false for collapse.
113
+
-`on-selection` : `(node, selected)`callback called whenever selecting a node in the tree. The callback expression can use the selected node (`node`) and a boolean which indicates if the node was selected or deselected (`selected`).
114
+
-`on-node-toggle` : `(node, expanded)`callback called whenever a node expands or collapses in the tree. The callback expression can use the toggled node (`node`) and a boolean which indicates expansion or collapse (`expanded`).
114
115
-`options` : different options to customize the tree control.
116
+
-`multiSelection` : [Boolean] enable multiple nodes selection in the tree.
115
117
-`nodeChildren` : the name of the property of each node that holds the node children. Defaults to 'children'.
116
118
-`dirSelectable` : are directories (nodes with children) selectable? If not, clicking on the dir label will expand and contact the dir. Defaults to `true`.
117
119
-`equality` : the function used to determine equality between old nodes and new ones when checking whether a replacement node should be expanded and/or marked as selected. Defaults to a function which uses `angular.equals()` on everything except the property indicated in `nodeChildren`.
<P>The tree supports events for selection and expansion of nodes. The events are set using the <code>on-selection</code> and <code>on-node-toggle</code> attributes
440
+
which values are evaluated as angular expressions (like `ng-click` value). The expression can use the `node` and `selected` variables (for on-selection) or
441
+
the `node` and `expanded` variables (for on-node-toggle) for context of the clicked node and if it was selected / deselected or expanded / collapsed.</P>
442
+
<p>Note the events are fired only on the clicked node. If using the tree in single selection mode and one node is selected, when selecting a different node
443
+
only one on-selection event will be fired for the newly selected node. The old selected node will not be selected anymore without an on-selected event.</p>
439
444
<p>In order to prevent selection of branches (folders) in the tree, set the <code>options.dirSelectable</code> to <code>false</code>.
440
445
Clicking folder labels at this point will expand and contract the node.</p>
<P>The tree control supports multi-selection using the `options.multiSelect` option and the `selected-nodes` attribute (instead of the `selected-node` attribute in single selection mode).
498
+
`selected-nodes` is expected to be an Array which will contain the selected nodes.
499
+
When using multi-selection, selecting a node adds it to the selected-nodes array and a second click remove it from the array.</p>
500
+
<divclass="row">
501
+
<divclass="col-md-6">
502
+
<p>Selected Nodes:</p>
503
+
<ulid="multi-selection-listing">
504
+
<ling-repeat="node in selectedNodes">{{node.label}}</li>
0 commit comments