angular-bootstrap-nav-tree
angular-bootstrap-nav-tree copied to clipboard
Expanding/Collapsing node triggers onSelect
Expanding or Collapsing node triggers onSelect callback. I am not sure if that is intended...
It would be acceptable if there was a way to differentiate if node was actually selected or only expanded/collapsed. Maybe bool property on branch object?
Maybe separate selected and expanded/collapsed event is a better way
I second this thought. This will help in order to do the following and eliminate the drawback.
Expand should open the node and fill in the child nodes if not already loaded. Collapse can be used to process the node if it is already expanded and its child nodes are already populated.
+1
++
+++ really need something to prevent selecting when user only want to organize visual tree.
++ I need an event to load branch from a service
I'm also looking to be able to distinguish expand/collapse from select.
As an ugly workaround I hacked the template of the directive as follows:
[...] <i ng-class=\"row.tree_icon\" ng-click=\"row.branch.expanded = !row.branch.expanded; $event.stopPropagation();\" [...]
I just added the $event.stopPropagation();
to the icon to prevent it from firing the select handler.