PDA

View Full Version : Panel Positioning using setPosition after Move Event



yuhimfresh
21 Oct 2010, 1:05 PM
I've been trying to create a draggable panel that repositions itself after it's dropped. It seems drag event is being fired but won't save the current position. Is there something I am doing incorrectly?



*/
Ext.onReady(function() {
Ext.QuickTips.init();
var left = new Ext.Panel({
height: 500,
width: 600,
renderTo: Ext.getBody(),
draggable: {
insertProxy: false,
onDrag: function(e){
console.log('DRAGGING');
var pel = this.proxy.getEl();
this.x = pel.getLeft(true);
this.y = pel.getTop(true);

},
endDrag: function(e){
console.log('RELEASE');
//console.log(this.x + ' ' + this.y)
left.setPosition(this.x, this.y);
}


}
});

});


Thanks in advanced,
extJS n00b

yuhimfresh
21 Oct 2010, 2:31 PM
False call, was missing the floating attribute.