PDA

View Full Version : treenode copy



joe123
12 May 2010, 3:52 AM
Hi,

I'd like to copy a node. Using:

var newnode = dropEvent.tree.getLoader().createNode(node.attributes);

or

var newnode = new Ext.tree.TreeNode(node.attributes);

They both don't copy the child nodes.... SHould I do this myself or are there other ways?

Thanks, Joe123

Eugen_
12 May 2010, 4:05 AM
Hi Joe123,

try to use the AsyncTreeNode and get child nodes from server asynchronous

joe123
12 May 2010, 4:15 AM
Thanks!

I am going to try to do that! But after all It would also be usefull to be able to clone a node
with it's children.


Cheers

Condor
12 May 2010, 5:01 AM
You'll need to write a recursive method that clones a node and adds clones of all children.