iVantage / angular-ivh-treeview

A treeview for AngularJS with filtering and checkbox support.
http://ivantage.github.io/angular-ivh-treeview/
MIT License
238 stars 89 forks source link

On the selection status of the parent node #211

Closed ToView closed 7 years ago

ToView commented 7 years ago

The parent node has a child node that is not selected, but the other child nodes are selected, and the parent node's selection state is false.Is that right?

image

jtrussell commented 7 years ago

Yep, that's right.

Here's the section of code that determines a parent status whenever a child changes state:

https://github.com/iVantage/angular-ivh-treeview/blob/master/src/scripts/services/ivh-treeview-mgr.js#L48-L57

A parent will be marked as selected exactly when all of its children have been marked as selected.

ToView commented 7 years ago

Thank you for your answer.