Hello,
When a node is deleted through client side javascript code, the tri-state check box functionality is not working as expected.
Check state of the ancestors of the deleted node are not updated.
Only parent of the deleted node's checkstate gets updated. Grand Parent of the deleted node's check state is not updated.
please find below code for deleting a node.
But when a new node is added to the tree, corresponding ancestors check state is updated as expected. Adding a new node to the tree is not a problem.
Please find below code for adding new node.
Please help me with this problem.
Thanks in advance,
ravi
When a node is deleted through client side javascript code, the tri-state check box functionality is not working as expected.
Check state of the ancestors of the deleted node are not updated.
Only parent of the deleted node's checkstate gets updated. Grand Parent of the deleted node's check state is not updated.
please find below code for deleting a node.
function DeleteNode(nodeID) { |
var tree = $find("<%= RadTreeView1.ClientID%>"); |
var node = tree.findNodeByValue(nodeID); |
tree.trackChanges(); |
node.get_parent().get_nodes().remove(node); |
tree.commitChanges(); |
} |
But when a new node is added to the tree, corresponding ancestors check state is updated as expected. Adding a new node to the tree is not a problem.
Please find below code for adding new node.
function AddNewNode(newNodeID, title, direction, siblingNodeid, parentid) { |
var tree = $find("<%= RadTreeView1.ClientID%>"); |
var pnode = tree.findNodeByValue(parentid); |
var snode = tree.findNodeByValue(siblingNodeid); |
var index = snode.get_index(); |
tree.trackChanges(); |
var newnewnode = new Telerik.Web.UI.RadTreeNode(); |
if (direction == "below") { |
pnode.get_nodes().insert(index + 1, newnode); |
} else { |
pnode.get_nodes().insert(index, newnode); |
} |
newnode.set_value(newNodeID); |
newnode.set_imageUrl("../images/GreenDot.gif"); |
newnode.set_cssClass("tree-node"); |
var attributes = newnode.get_attributes(); |
attributes.setAttribute("NodeName", title); |
attributes.setAttribute("ParentID", parentid); |
var html = ""; |
var x = 0; |
html += " <img src='../images/Q.gif' align='bottom' border='0'/>"; |
x |= 1; |
newnode.get_attributes().setAttribute("Properties", x); |
newnode.get_textElement().innerHTML = title + html; |
tree.commitChanges(); |
} |
Please help me with this problem.
Thanks in advance,
ravi