Closed davidfrias closed 7 years ago
Any chance you have the validate
option set to false
?
https://github.com/iVantage/angular-ivh-treeview#validate-on-startup
This example demonstrates, nodes with an indeterminate state on startup:
http://jsbin.com/ruxedo/edit?html,js,output
If that doesn't help, maybe you could use the template in our README to provide an example of it not working?
I've set the validate
to false
but it still display the tree wihout tristate behavior.
I made this example: http://jsbin.com/zoqexaroqo/edit?html,js,output
Shouldn't "Fountain" node be with indeterminate state since nodes "two" and "three" are set in false?
Nevertheless when you then click nodes "two" and "three" (to change state to 'false') its parent change to indeterminate state.
Validation is top-down. In the example "Fountain" has selected: true
and that overrides the initial selected state of it's child nodes. This is due to the interplay between validation being top-down and your default selected state being false
- i.e. when we find a node (starting from the root) with a selected state that differs from the default, we assume that's intentional and update the rest of the tree accordingly.
In this specific case you could remove selected: true
from "Fountain" and I think it will work as you expect.
Ok Thank you!
👍
Hi! It seems tristate functionality is not working properly in the very first load and when you have more than two level in the tree. But after interacting with the tree it works properly.