EagleFox EagleFox - 1 year ago 65
Javascript Question

how to get value of a node where a leaf is dropped in a tree

I have a tree panel where a leaf can be dropped to a node. I want to get the value of that node where the leaf is dropped.

Doing this gets me the first node and not the node where I dropped the leaf


I also tried


but this doesn't work when the node is expanded..

Kld Kld
Answer Source
listeners: {
    drop: function(node, data, overModel, dropPosition,  dropFunction,  eOpts ){
         console.log(data.records[0].parentNode.data);//old parent 
         console.log( overModel.parentNode.data);//new parent
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download