PDA

View Full Version : How to capture the on end event in portal demo



pk.hafeez
9 Dec 2012, 9:15 AM
Hi,

I'm using portal demo example given in
http://docs.sencha.com/ext-js/4-1/#!/example/portal/portal.html

I want to do something after the portlet has been completely dragged and dropped. May be x and y positions after drag and drop is over. is there any listener i can write like onEnd ?

mitchellsimoens
11 Dec 2012, 6:55 AM
The draggable config on the portlet, you should be able to pass in listeners that will use Ext.util.ComponentDragger. It has some events like dragend that may help you.

pk.hafeez
11 Dec 2012, 8:02 AM
Tried something like this. Dint work. Some javascript error this.getProxy() is null. :(



draggable: {
insertProxy: false,
onDrag: function(e) {
// var el = this.proxy.getEl();
// this.x = el.getX();
// this.y = el.getY();
},
endDrag: function(e) {
// panel.setPosition(this.x,this.y);
myFunction();
},
alignElWithMouse: function() {
// panel.dd.superclass.superclass.alignElWithMouse.apply(panel.dd, arguments);
// this.proxy.sync();
}
}