Client-side script does not work

2 posts, 0 answers
  1. Michael
    Michael avatar
    6 posts
    Member since:
    May 2007

    Posted 03 Apr 2009 Link to this post

    I am using the RadTree in the ASP.NET AJAX Toolkit and have run into a problem.  I cannot use the tri-state functionality for certain situations in my code and must use a custom JavaScript function to uncheck parent nodes when the child node is unselected.  I found this snippet in the knowledge base.  Unfortunately it does not work as promised. 

    When I run this code it unchecks the parent node but also unchecks all of the current nodes siblings.  I put an alert function in the while loop and found that it returns a message that says “I am unchecking  undefined”.  What am I missing?  Thank you.

     

    function clientNodeChecked(sender, eventArgs)

            {

               var node = eventArgs.get_node();  

               alert("I am unchecking " + node.Text);    

                if (!node.get_checked())

                {      

                    while (node.get_parent().set_checked != null)

                    {

                        node.get_parent().set_checked(false);

                        node = node.get_parent();

                        alert("I am unchecking " + node.Text);

                    }

                }

            }

  2. Michael
    Michael avatar
    6 posts
    Member since:
    May 2007

    Posted 03 Apr 2009 Link to this post

    I found what I was missing.  It was a simple fix.  I had to set the property that updates child nodes to false.  I then added to the Javascript above to get the behavior I needed.
Back to Top