This is a migrated thread and some comments may be shown as answers.

Treeview doesn't support javascript codes

1 Answer 107 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
naveen veda
Top achievements
Rank 1
naveen veda asked on 25 May 2009, 10:16 AM

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,

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 May 2009, 01:20 PM

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

Tags
TreeView
Asked by
naveen veda
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or