Treeview doesn't support javascript codes

2 posts, 0 answers
  1. naveen veda
    naveen veda avatar
    47 posts
    Member since:
    Jul 2012

    Posted 25 May 2009 Link to this post

    hi,

    i am using Radtreeview for asp.net ajax controls.

    in java script,

    node.get_checked() code gives error as  " Object doesn't support this property or method"

    my code is,

    function AfterCheck(node)

     

    {

     

    if (!node.Checked && node.Parent != null)

     

    {

    node.Parent.UnCheck();

    }

     

     

    var siblingCollection = (node.Parent != null) ? node.Parent.Nodes : node.TreeView.Nodes;

     

     

    var allChecked = true;

     

     

    for (var i=0; i < siblingCollection.length; i++)

     

    {

     

    if (!siblingCollection[i].Checked)

     

    {

    allChecked =

    false;

     

     

    break;

     

    }

    }

     

    if (allChecked && node.Parent != null)

     

    {

    node.Parent.Check();

    }

     

    UpdateAllChildren(node.Nodes, node.Checked);

    }

     

     

     

     

    function

    UpdateAllChildren(nodes, checked)

     

    {

     

    var i;

     

     

    for (i=0; i<nodes.length; i++)

     

    {

     

    if (checked)

     

    nodes[i].Check();

     

    else

     

    nodes[i].UnCheck();

     

     

    if (nodes[i].Nodes.length > 0)

     

    UpdateAllChildren(nodes[i].Nodes, checked);

    }

    }

    previous version (Rad controls for Asp.Net)  the above code works fine,

    can u give me the solution.

    thanks,

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 May 2009 Link to this post

    Hi Naveen,

    I guess you want all child Nodes of a Node are automatically Checked if their parent has been Checked and Unchecked if their parent has been Unchecked. If so you can try setting the CheckChildNodes property to True. You can find the important client side methods and events of RadTreeView for ASP.NET AJAX by going through following links.
    Client-Side Programming Basics
    RadTreeNode
    RadTreeView
    Client-Side Events

    -Princy

Back to Top