vakata / jstree

jquery tree plugin
http://jstree.com
MIT License
5.13k stars 1.39k forks source link

copy-paste operation in jstree #2729

Closed shrey-code closed 1 year ago

shrey-code commented 1 year ago

I,m also implementing a tree using jstree ,i need to do copy-paste operation.But i'm not able to copy a node (parent with children) and paste it to some other node. Copy and paste operation are going smooth. but when i save the tree it doesn't updates the UI like this

Initial Structure

- NFR (Parent)
 - Logging (child of NFR)
 - Tracing (child of NFR)
- Project Vision Statement

Assume this is my tree.I need to copy() NFR along with its child nodes and need to paste under Project Vision Statement. After copy and paste it shows the changes like this

- NFR (Parent)
 - Logging (child of NFR)
 - Tracing (child of NFR)
- Project Vision Statement
 - NFR
  - Logging
  - Tracing

But when i save the tree and again re open it, the rendered tree body appears like this

- NFR (Parent)
 - Logging (child of NFR)
 - Tracing (child of NFR)
- Project Vision Statement
 - NFR

How do i let the child nodes of NFR to be rendered alongside with NFR?

vakata commented 1 year ago

This seems like a problem with saving the modified tree to the server side. There is nothing jstree can do with that - make sure you are copying the source node along with its children on the back-end. Let me know if I can help further.