View Full Version : [INFOREQ] isOverTarget function can't tell when 1 drop zone is on top of another

16 May 2010, 2:26 PM
Hi All

I ran into an odd bug lately where when I had a tree in a window, if I tried to drop nodes into the tree I would end up firing 2 node drop events.

The problem as it turns out is that under the window with the treepanel in it I also another treepanel, and the call to the isOverTarget function in the fireEvents functions of the Ext.dd.DragDropMgr class thought that 2 drops were going on -- one to the tree in the window on top, and one to tree below the window (looks like it just checked to see if your mouse coordinates intersect the rect of any of the drop zones, so z-index doesn't really matter).

Perhaps an additional for loop should be added to filter out the results even further to have the drop only effect the drop zone that is under the mouse and has the highest z-index (This maybe could be accomplished by looking for the highest z-index encountered in any of the containers of each drop zone).

Not a terrible bug but seemed worth reporting (I am fixing it for my self by just by assigning separate drag and drop groups to the 2 trees).

Best Regards

Will Ferrer

Jamie Avins
16 May 2010, 3:43 PM
Sort of the purpose of having different ddGroups assigned. Otherwise it could get quite expensive to look for the dropTarget.