Completed
Last Updated: 19 Sep 2016 14:29 by Wagner
ADMIN
Peter Milchev
Created on: 23 Jun 2016 08:20
Category: UI for ASP.NET AJAX
Type: Bug Report
0
rtIndeterminate class is not removed from the parent TreeView node when a child is checked

		
1 comment
Wagner
Posted on: 22 Aug 2016 17:04
workaround:

<telerik:RadTreeView OnClientNodeChecked="AfterCheck" ... />

<script>
    function AfterCheck(tree, ev) {
        TriStateCheck(tree.get_nodes());
    }

    function TriStateCheck(nodes) {
        for (var i = 0; i < nodes.get_count() ; i++) {
            var node = nodes.getNode(i);
            if (node.get_nodes().get_count() < 1) {
                // only last level is necessary
                var old = node.get_checked();
                node.set_checked(old); 
            }
            else {
                TriStateCheck(node.get_nodes()); // reentrance
            }
        }
    }
</script>