Copy one tree to another tree #2683
-
Hi all, I just recently started to use jstree, so I apologize if me questions are silly. I seasched the web as well as this group, but found nothing on the topic copy_node function. I have a main tree, and I want to create an xact copy of this in a setup dialog, where I need to enable the checkbox plugin. I use the function copy_node and I get an exact copy - that is great. However, the ids are different in my new tree, and I am having problems establishing a reference between the 2 sets of id's. I found an old answer which tells me to do this
Which make much sense but unfortunately does not work. Both my tree's are using sort plugin, but I was told that children_d is not sorted in any way. Does anybody have this code working, any ideas, or alternatives I am very appreciated. Kind Regards Henrik PS I attached a screenshot, the green ones are ok, but the rd ones are not.... PPS I made a Fiddle where ID is revealed on node click here |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi all, After a sleepless night, the obvious solution revealed itself in all it's simplicity. The source tree already exist, so I can just grab the data and provide that to the destination tree upon creation.
Just or even more easy and it works like it should.... KInd regards Henrik |
Beta Was this translation helpful? Give feedback.
Hi all,
After a sleepless night, the obvious solution revealed itself in all it's simplicity.
The source tree already exist, so I can just grab the data and provide that to the destination tree upon creation.
Just or even more e…