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

select and deselect all method doesn't work on customized children #219

Closed xessam closed 5 years ago

xessam commented 5 years ago

Hi, can some one explain me why selectAll method doesn't select nodes on this example

https://jsbin.com/mirayijocu/7/edit?html,js,output

jtrussell commented 5 years ago

The tree in your example has a custom childrenAttribute property, the ivhTreeviewMgr service doesn't know about the custom property and is still looking for child nodes using the default property. As a general rule if you give the ivh-treeview directive a set of options (i.e. if you use ivh-treeview-optons="...") you'll likely also want to pass those same options to any of the helper services.

For example, this should work:

  this.selectAll = function() {
    ivhTreeviewMgr.selectAll(this.stuff, this.customOpts)
  }