PDA

View Full Version : dropTarget and notifyDrop don't get called



lsaffre
25 Oct 2010, 6:16 PM
Hi all,

I am trying to make a Panel that reacts when an URL address from another browser window has been dropped onto it. I looked at the dd examples and the documentation, and here is where I reached:


function initializeDropZone(cmp) {
console.log('initializeDropZone',cmp);
cmp.dropTarget = new Ext.dd.DropTarget(cmp.body.dom, {
notifyEnter : function(ddSource, e, data) {
console.log('notifyEnter',ddSource,e,data);
},
notifyDrop : function(ddSource, e, data){
console.log('notifyDrop',ddSource,e,data);
return(true);
}
})
}

Ext.onReady(function() {
var dropPanel = {
html: 'Drop something here',
listeners: { render: initializeDropZone}
};

var win = new Ext.Window({
width: 600, height:600,
layout:'fit',
maximizable: true,
items: dropPanel
});
win.show();

});



When I run this code, initializeDropZone() gets called, but when I drag an URL from another browser window onto the panel, my dropTarget and notifyDrop functions don't get called.

What am I missing? Thanks for any hint.

Luc