PDA

View Full Version : How to destroy an Ext.Resizable object



neteor
28 Jan 2010, 8:13 AM
Hi all,

I've a code that generate Ext.Resizable objects "on demand".
All of these scope IMG tags.

Can I "destroy" the JS Resizable objects after the resize completed ?

"destroy" means the blue border disappear and the image is not resizable.

Sorry for my english...



<script type="text/javascript">
function ResizeElement(element_id) {
var wrapped = new Ext.Resizable('img' + element_id, {
wrap:true,
pinned:true,
minWidth:50, minHeight: 50,
preserveRatio: true,dynamic:true,
handles: 'all'
, listeners: {
, resize: function(resizer, width, height) {
// HOW TO destroy this object and remove all "borders" and "events" ????
}
}
});
}
</script>

hhanna
28 Jan 2010, 11:42 AM
Next time, try to find it in the documentation
http://www.extjs.com/deploy/dev/docs/?class=Ext.Resizable (http://www.extjs.com/forum/../deploy/dev/docs/?class=Ext.Resizable)

The destroy method is clearly defined.

In your case, you can replace your resize listener with the following:


resize: function (resizer, width, height) {
resizer.destroy();
}