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

Tri-State checkboxe functionality is not working, When a node is deleted.

1 Answer 71 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ravi Sanker
Top achievements
Rank 1
Ravi Sanker asked on 25 Jul 2009, 09:19 PM
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.

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 += "&nbsp;<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



1 Answer, 1 is accepted

Sort by
0
Dimitar Milushev
Telerik team
answered on 29 Jul 2009, 11:30 AM
Hello Ravi Sanker,

This was confirmed as a bug in RadTreeView. We are working on a fix and the fix will be included in the next Service Pack of the RadControls suite.

Please excuse us for the inconvenience.

Kind regards,
Dimitar Milushev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
Ravi Sanker
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
Share this question
or