TriState and

2 posts, 1 answers
  1. Oren
    Oren avatar
    6 posts
    Member since:
    Dec 2010

    Posted 31 Jan 2011 Link to this post

    Hello,

    I use a treeview include tristate mode.
    My problem is that:

    When i get the checkeble nodes with the following js function,
     var nodes = treeview.get_checkedNodes();
    I get also the parent node that its state is indeterminate.

    [¦] Parent
        [X] Child 1
        [X] Child 2
        [  ] Child 3

    Is there any way to get only the checkeble nodes with no indeterminate state?

    Thanks,
    Oren
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 31 Jan 2011 Link to this post

    Hi Oren,

    I tried following approach to get the checked nodes when using TriState cehckboxes.

    Client Code:
    function getChecked() {
        var tree = $find("<%= RadTreeView1.ClientID %>");
        var allNodes = tree.get_allNodes();
        var chekedIndex = 0;
        var checkedNodes = new Array();
        for (var index=0; index < allNodes.length; index++) {
            if (allNodes[index].get_checkState() == 1) {
                checkedNodes[chekedIndex] = allNodes[index];
                chekedIndex++;
            }
        }
        alert(checkedNodes.length);
    }



    Thanks,
    Princy.
Back to Top