I'm trying to fire an an OnNodeCheck event from Javascript when the node is selected using the following code:
function
RadTreeView1_OnNodeClick(sender, eventArgs)
{
var tree = $find("ctl00_Main_RadTreeView1");
var node = tree.get_selectedNode();
if(node)
{
node.expand();
if (node.get_value() != '-1')
{
if(node.get_checked())
{
//node.set_checked(false);
node.uncheck();
}
else
{
node.set_checked(true);
node.check();
__doPostBack('ctl00$Main$RadTreeView1', '{"commandName":"Check","index":"1:0"}');
}
}
}
}
This is the only way that I can seem to get the code to fire, however I can't seem to find the index of the checkbox I'm firing the code from. Is there a method to pull the placement index of the child node, eg. 1:0 from the inbuilt methods or am I going to have to add a loop to the treeview to try and build this manually?
Any help would be greatly appreciated.
Cheers
Dale