Hi,
I am currently doing some drag and drop client-side functionality and am comming across some issues when expanding the node using the client-side javascript call RadTreeNode.expand().
The expand call works correctly and the chil nodes are visible in the tree, but the parent node does not have the 'minus' image next to it so the user is not able to collapse the node.
The code I am using is as follows and is called after returning from a WS call :
The above code is creating a brand new node instead of just moving the original source node, but I have tried doing it that way as well.
This only happens when using expand(), if I create a child node and add it into the get_nodes() collection the 'minus' appear as expected.
Am I missing something that will stop this happening?
Thanks
I am currently doing some drag and drop client-side functionality and am comming across some issues when expanding the node using the client-side javascript call RadTreeNode.expand().
The expand call works correctly and the chil nodes are visible in the tree, but the parent node does not have the 'minus' image next to it so the user is not able to collapse the node.
The code I am using is as follows and is called after returning from a WS call :
| function OnDragDropComplete(result) |
| { |
| if (result != null && result.Successful) |
| { |
| //ctree.trackChanges(); |
| var SourceNode = ctree.findNodeByValue(result.SourceNodeID); |
| var DestNode = ctree.findNodeByValue(result.DestNodeID); |
| var childNode = new Telerik.Web.UI.RadTreeNode(); |
| childNode.set_value(result.NewNodeID); |
| childNode.set_text(SourceNode.get_text()); |
| childNode.set_imageUrl(SourceNode.get_imageUrl()); |
| childNode.get_attributes().setAttribute("Category",SourceNode.get_attributes().getAttribute("Category")) |
| childNode.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ServerSideCallBack); |
| SourceNode.get_parent().get_nodes().remove(SourceNode); |
| for(var i = 0; i < DestNode.get_nodes().get_count(); i ++) |
| { |
| if (DestNode.get_nodes().getNode(i).get_text().toLowerCase() > childNode.get_text().toLowerCase()) |
| { |
| DestNode.get_nodes().insert(i,childNode); |
| //alert(DestNode.get_nodes().getNode(i).get_value()); |
| DestNode.get_nodes().getNode(i).expand(); |
| return; |
| } |
| } |
| DestNode.get_nodes().add(childNode); |
| //ctree.commitChanges(); |
| ctree.findNodeByValue(result.NewNodeID).expand(); |
| } |
| } |
The above code is creating a brand new node instead of just moving the original source node, but I have tried doing it that way as well.
This only happens when using expand(), if I create a child node and add it into the get_nodes() collection the 'minus' appear as expected.
Am I missing something that will stop this happening?
Thanks
