I have a two-level treeview with SingleExpandPath = true and CheckBoxes = true. It is bound to a database. I have used the scripts found on the Telerik site so that it will check all chidren when a parent is checked and unchecks a parent when any child is unchecked.
When I load the treeview, I change the color of the parent if there are any child nodes checked. This gives the user a quick visual that one or more of the child nodes for that particular parent are selected even if the parent is not. My next step was to use the ClientNodeChecked event to walk through the checked nodes using treeview.get_checkedNodes and modifying the node.get_textElement().style.color for the parent or self. My problem is when a node is unchecked.
What I am looking for is 2-part:
1. A quick way to set any parents to a default color, then;
2. A quick way to set the color for all parents of a node
I am trying to avoid trying to walk through every single node when a user checks / unchecks a box. I'm hoping that there is an easy way - which I haven't found - to find out that a node has child nodes.
Thanks in advance for your help!
Steve
When I load the treeview, I change the color of the parent if there are any child nodes checked. This gives the user a quick visual that one or more of the child nodes for that particular parent are selected even if the parent is not. My next step was to use the ClientNodeChecked event to walk through the checked nodes using treeview.get_checkedNodes and modifying the node.get_textElement().style.color for the parent or self. My problem is when a node is unchecked.
What I am looking for is 2-part:
1. A quick way to set any parents to a default color, then;
2. A quick way to set the color for all parents of a node
I am trying to avoid trying to walk through every single node when a user checks / unchecks a box. I'm hoping that there is an easy way - which I haven't found - to find out that a node has child nodes.
Thanks in advance for your help!
Steve