EagleFox
EagleFox

Reputation: 1367

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

Ext.StoreMgr.lookup('myStore').tree.root.childNodes[0].get('nodeName')

I also tried

overModel.get('nodeName')

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

Upvotes: 2

Views: 312

Answers (1)

Kld
Kld

Reputation: 7068

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
     } 
}

Upvotes: 2

Related Questions