|
Title: drag and drop between different trees [Solved] Post by: devnull on May 20, 2014, 06:31:31 PM I need to be able to drag from one [source] tree into another [destination] tree.
I do NOT want to delete the [source] node, so that I can drag the same source node multiple times into the [destination] tree without deleting the source node. Is this possible ? Title: Re: drag and drop between different trees Post by: stworthy on May 20, 2014, 07:05:56 PM To prevent from deleting the source node, please return false in the 'onBeforeDrop' event. To continue appending or inserting nodes to the destination tree, you have to write code to achieve this functionality. Please refer to the code below:
Code: $('#t2').tree({Title: Re: drag and drop between different trees Post by: devnull on May 20, 2014, 08:06:53 PM Thanks so much for helping.
Great, that works very well, but I only need to append rather than insert, so the code only uses the append method. I also need to make sure that dropped elements are unique and can only be added to the parent (level 0) and if dropped onto a child, append to the parent instead, but I will try and figure that one out myself. |