In your example:
http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/contextmenu/defaultcs.aspx
On Deletion, you delete the node. I want to first check if there are any children for that node, and if so send a alert. How do I check if the selected TreeNode has children? The below treeNode.Nodes.length doesn't work. thanks!
http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/contextmenu/defaultcs.aspx
On Deletion, you delete the node. I want to first check if there are any children for that node, and if so send a alert. How do I check if the selected TreeNode has children? The below treeNode.Nodes.length doesn't work. thanks!
case "Delete":
if (treeNode.Nodes.length > 0) {
alert(
"Please remove content of this directory prior to deletion.");
}
else {
var result = confirm("Are you sure you want to delete the item: " + treeNode.get_text());
args.set_cancel(!result);
}
break;