PDA

View Full Version : How can I manually adjust the dropzone of an element ?



qbert65536
7 Dec 2012, 11:15 AM
I am using some CSS transformations that shifts the div upward, and its resulting in weird behavior when I drop an item on to it.

How can I manually say 'move this drop zone up 20 pixels' ?

slemmon
7 Dec 2012, 12:49 PM
I haven't tested this, but I wonder if this would work:
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.dd.DD-method-setPadding

Looks like you could get a reference to the dropZone and set the padding to: '-20 0 -20 0' or something like that to move the drop zone.

*Honestly, I'd have thought that the drop zone would follow the dom element as it moved. Otherwise how could you have a grid be the drop zone in a collapsible layout and not have the dropZone honor the moved/hidden grid element? That said... haven't given it too much thought before. :)

Good luck!

qbert65536
7 Dec 2012, 1:08 PM
Hmm no luck. Oddly though, I'm using the onNodeOver methods to apply styling when hovering which works correctly, but when I release the mouse button it acts like it was on the step below it, screenshot attached.

I might try to just get the local coordinates of the drop and if its > than X , select the target above it.