I am currently using multi Tree model and trying to get the parent node after dragging files from Source Tree. Is there any method avaliable to get the parent node after drag operation?.
I need to send the updated information to server as JSON file
Hi, Kavitha.
What you can use is the igTree `nodeDropeed` event and its arguments. Here is a demo that is using the event and gets parent node information. You can check all the available properties of the `ui` argument. The code that I have added is the following:
nodeDropped: function(evt, ui) { console.log(ui.path); console.log(ui.data); }
I will wait for your feedback. Thank you for using our product!
Best regards,
Nikolay Alipiev
Software Developer
Thank you for the help. ABove provided DEMO url is not working..
In the below diagram I dragged "MY DOCUMENTS" folder from destination to Source tree ."node dropped" event is not retrieving the whole tree(My DOcuments ,Pictures) information its retrieving only Music folder information. Its getting only parent(Music folder) information. I need to save the whole source tree information when any drag operation occured. I have to save the source tree information in the local desk with upto date..
I think that the nodeDataFor method is what you need:
ui.owner.nodeDataFor(ui.path);
Regards,
Thank you for providing the link. "ui.data.folder" is not providing the entire tree of JSON its providing child -2 and child-1 level information. I want to retrieve the parent node level with child-1 and child- 2 level information.
For example:
Parent
Child-1
Child-
Child-3
Child-4
If I drop any file to child -4 "node dropped"function giving child -3 JSON data. I want to retrieve data from Parent node to child -4 with updated drag file information into a JSON file. There is no method existed to provide the Parent node information after dragging. Can you please suggest the approach?
Sorry for the demo link, here it is.
In the demo, you can see that using `ui.data.Folder` will give you JSON with all the data in the update tree, that contains also the dropped node data.
If you don't want the data from the root node, but from some other node then you can get that node and then get all the direct children of the parent node as an array and continue with the children on the next level. I've updated the demo above with the following code: `ui.owner.nodeByPath(ui.path).children()`.
Thanks