Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
225
How to transfer nodes from Source to Target DataTree while retaining their relative position in tree.
posted

There are various ways to select items of Data tree like mouse click selection, check box based etc.

 I have a special need for transfer nodes as below -

1) There will be 2 data trees as Source and Target and some buttons like TransferToSource, TransferToTarget to transfer nodes from one tree to another

2) Initially only Source Tree is populated with data and Target tree is blank.

3) TransferToTarget  should work in a manner that all selected nodes from Source Tree should be transferred to Target tree while retaining their relative positions (hierarchy) in tree.

Example -

      + parent1

          +  child1

              -  grandchild1

               - grandchild2

          +  child2

If grandchild1 above is selected for transfer, entire parent1, child1 and grandchild1 nodes should be transferred to other tree.

if child1 is selected for transfer, parent1, child1 should be transferred alongwith grandchild1 and grandchild2

Also when any nodes are transferred to target tree, they should be removed from source tree.

This should work for multiple selections too.

Let me know if you have any solutions to this.

Parents Reply Children