PDA

View Full Version : Drag Event on Resizable Object handler



einavb
4 Aug 2009, 11:30 PM
I am trying to change the color of the resizable object during the resize action.
Is is possible to catch the object resize handler drag event ?


var basic = new Ext.Resizable('basic', {
width: 200,
height: 400,
minWidth:100,
minHeight:50,
maxHeight:400,
dynamic:true,
handles: 'e'
});
basic.east.on('drag', changeColor);
Any assistance will be vastly appreciated.
Einav.

Condor
4 Aug 2009, 11:36 PM
Resizable has a beforeresize event that you can use for this.

(and you probably want to change the color back in the resize event)

einavb
4 Aug 2009, 11:44 PM
condor thanks for your prompt response !

But I am trying to change the color during the resize action.
e.g while the element handler is dragged and becomes larger, I want it to have a darker color.

Or am I missing something.

Einav.

Condor
4 Aug 2009, 11:56 PM
There is no event for that.

Are you using dynamic:true? In that case you can override the resizeElement method:

var basic = new Ext.Resizable('basic', {
resizeElement: function(){
var box = this.constructor.prototype.resizeElement.call(this);
...
return box;
}
});

If not, then you can override the onMouseMove method (but that requires a bit more work).

Animal
4 Aug 2009, 11:57 PM
Use the beforeresize event

einavb
5 Aug 2009, 12:02 AM
Condor, the resizeElement function override did the trick !!
Thank you very much.

=D>

Condor
5 Aug 2009, 12:02 AM
Use the beforeresize event

No, I think the OP is looking for an event that fires during resizing (which doesn't exist).

Animal
5 Aug 2009, 12:24 AM
Ah, I see the need for an FR. Notification during resizing could be useful.

Animal
5 Aug 2009, 12:28 AM
http://extjs.com/forum/showthread.php?p=368711