Hi,
My Version: 2008 vol 1 for CLR 3.5
When I try to drag and drop a Node that has children from one WebTree to another, only the current node is dropped on the target. Any child node on the source node is not dropped on the target. I have checked your sample which also behaves the same way. Does that mean I cannot move or copy a Node alongwith it's children? That doesn't sound right. If I need to change the javascript function to achieve that, could you please show me a sample script that can do it? I am not a guru on java script.
Thanks.
I have no idea how you are dropping from one tree to another, but i guess you have to loop thjrough the children of the dragged node and then add this to another tree.
Please try this
function AddChildNodesRecursive(childNode, parentNode) { var newChild = parentNode.addChild(childNode.getText()); if (childNode.hasChildren()) { var children = childNode.getChildNodes(); for (c in children) { var childSubNode = children[ c ]; AddChildNodesRecursive(childSubNode, newChild); } } }
Thanks Rajan,
This is exactly what I did. I found the exact same function on the forum, implemented it and it works fine. If you wrote this function, thanks a lot for it.
Babu.