28 Sep 2010 8:20 AM #1
Losing drag proxy in embed...mouse speed related.
Howdy. Thanks in advance for your help.
I am using DDProxy to drag an icon around. When I am dragging the icon over the toolbar, it works fine, but when I drag it over an embedded graph <embed src= et. /> I 'lose' the icon and it hangs (the icon, not the browser). Interestingly, this is related to the direction of the drag and the positioning of the mouse over the proxy el. I.e. if I setDelta(middle, middle) in my startDrag override, it becomes far less sensitive to losing the icon. When I setDelta() to the corner of the proxy it becomes extremely sensitive (and that is unfortunately what I need).
I suspect the onMouseMove code within my embed is interfering with the dragging code...and that it is a timing issue. Unfortunately my intention is to make the onMouseMove code more complicated, not less (I'm adding some fairly complex functionality to an already complex page).
Any thoughts on how I can workaround this problem would be appreciated.
The embed does live within an ext panel, if that helps at all...
29 Sep 2010 10:54 AM #2
So I think I know 'how' to fix this, but I'm not sure how to implement it.
The embed seems to play havok with mousemove type events. I tried to move all the onmousemove code to the container that encapsulates the embed (container_var.getEl.addListener('mousemove', function), and it performed terribly (the event would fire intermittently only when crossing container boundaries).
My thinking here is I should turn this around and override the DDProxy mousemove event handler so that the embed code is calling it when I'm in the embed.
My question....how do I do this? How do I manually capture and forward the mousemove events to DDProxy when in the embed, but let Ext do it when not in the embed?
29 Sep 2010 1:22 PM #3
I'm calling a delegate of ext.dd.DragDropMgr.handleMouseMove(evt).
However, it expects an Ext wrapped event, not a browser event.
Is there a way I can easily wrap this...a browser event->ext event converter???
29 Sep 2010 1:51 PM #4
It appears Ext.EventObject.setEvent(browserevent) will do this.
Now a related problem crops up...the value for clientY in the onmousemove event for the embed is relative to the embed, not the document. I cannot set a getter...so I'm not sure what the best way to deal with this is...make a writable copy of the event? Is their an easier way?
29 Sep 2010 2:01 PM #5
If I do make a copy (new Object(browserevent)) I get the strange error...too much recursion. I guess the object is way too deep.
Any thoughts on how to correct for the misplacement of the y axis in the embed's onmousemove?
I feel like I'm really close here. The dragged icon does not get lost over the embed anymore (it doesn't hang), rather it is just offset by the size of the toolbar (or double it)..........
29 Sep 2010 2:30 PM #6
I'm looking for a place to override the code that 'pulls' the proxy element back under the mouse so that I can add an offset to the event that I can look for in that code.
Where does this code live? I'm searching and having some trouble finding it...
By holdhope in forum Ext 3.x: Help & DiscussionReplies: 4Last Post: 20 May 2010, 12:46 AM
By gtomalesky in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 28 Oct 2008, 2:27 PM
By zen in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 21 Aug 2008, 2:52 AM
By yazan_rababa in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 1 Jun 2008, 4:53 AM
By xtrafile in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 16 Jul 2007, 7:01 PM