PDA

View Full Version : Drag and Drop onto a panel



markrobertshaw
23 May 2008, 5:46 AM
Hi There

Try as I might I can't seem to get drag and drop to work in my Air / Ext-JS application. I have copied the code from the Simple Tasks example (i.e. adding an on drop event to the body of one of my panels) using a simple alert function as the handler. When I attempt to drag a file or a piece of text onto the panel in question I get nothing (and no errors on the console either). It's as if the event is not registered. I have tried the following permutations to no avail.

1) Simple Tasks way

panel.body.on ("drop", function(e){
alert("Boo");
});


2) Manual Dom way

document.getElementById("mypanel").addEventListener("drop", function(e){
alert("Boo");
});

or document.getElementById("mypanel").ondrop = function(e){
alert("Boo");
}


Any suggestions as to how I can get drag and drop to fire correctly for a panel?

Thanks

Mark

markrobertshaw
23 May 2008, 6:17 AM
Hi there Rob

I was under the impression that application / system wide drag and drop would not work in a web browser and only in the AIR environment. Therefore there would be little point trying to get it working in a Browser.

Thanks

Mark

RobSmith
23 May 2008, 6:19 AM
I am sorry, I realized my stupid answer ... but not fast enough. ;-)

I will perform some tests concerning your issue.

RobSmith
23 May 2008, 7:07 AM
Sorry, but I could not get the grip on this. By default there is no 'drop' event for elements. But I also could not find the place where Jack added this event to the panels underlying element. For sure the solution for this issue is clear when digging deeper into the ExtJs code but I could not continue this until monday.