PDA

View Full Version : Detect ID of dropzone element



debarshi1990
9 Nov 2013, 1:18 AM
Hi,
I have a panel set as Dropzone


{
xtype:'panel',
listeners: {
render: function(cmp){
var dropOff = new Ext.dd.DropZone(cmp.getEl(), {
ddGroup: 'drag',
notifyDrop: function (dd, e, data) {
}
});
}
}
}




Now there can be many elements inside the panel....and when i am dropping something from a tree panel to this panel how to get the id or the element on top of which i dropped

slemmon
23 Nov 2013, 12:18 AM
The third param for onNodeDrop:
http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.dd.DropZone-method-onNodeDrop
is the mouse event and from it you should be able to get the element where the drop occurred.


onNodeDrop: function (nodeData, source, e) {
console.log(Ext.get(e.getTarget()).id);
}