I have created a custom Tree View with a checkbox. Now I need to uncheck the corresponding parent level node when I uncheck the corresponding child node.
eg: in my case, let's check all checkbox then if I uncheck the node named "fifth-b" then all belong to the parent node such as "fourth", "third-b", "second-a", "first" checkboxes are needs to be unchecked automatically.
I want to develop a completely custom tree view with checkbox and collapsible hence no other plugin or Material design we can use.
Please find my code at -
https://stackblitz.com/edit/angular-7xcthz
I appreciate your great help.
You may try something like iterating over the entire tree to find the node, for example, you may write some function like:
And then call this method in selectNode method:
Alternatively, you may also have a property 'parent:TreeNode' in 'TreeNode' interface.