PDA

View Full Version : cannot seem to clear constraints when dragging an element



scheid
12 Jul 2012, 6:56 AM
Hi all,

I'm stumped on this one. I am doing a fairly simple drag and drop operation. I have an Ext.Label (in an Ext.Panel) with HTML in it, and there are various span elements in the HTML string that I am setting up as draggable, like this (the overrides object, not included here as it's big, overrides the various drag events):



var lbl = Ext.ComponentQuery.query("#testLabel")[0];
var els = Ext.get(lbl.getEl()).select("span");


Ext.each(els.elements,
function(el) {
var dd = new Ext.dd.DD(el, 'myGroup', { isTarget: false });
Ext.apply(dd, overrides);
});



The HTML inside of the label is fairly simple; something like this:



<div>you can drag <span class="DragItem">this item</span></div>


This works fine for drag and drop operations. I get the drag behavior I want and the drops, etc. work fine.

The problem is that I cannot drag any of the span elements above or to the left of the original element position. I can drag a given element anywhere that is below and to the right of the original position. Seems like a constraint is set on it, but it doesn't help even when I call clearConstraints() in the b4StartDrag event.

From what I can tell, I've followed the D&D demo, and I can't see what I'm missing.

Thanks for any insights.

scheid
17 Jul 2012, 5:06 AM
anyone?? Bueller??