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);
}
}
}