I have an extjs panel. I need to induce a drag and resizing property for this panel.
This is the code for creating the panel:
var childPanel = new Ext.Panel({
draggable: true,
layout: 'fit',
................
});
I have achieved drag and resizing properties using the code:
Ext.override(Ext.Panel, {
// private
initEvents: function () {
if (this.draggable) {
this.initDraggable();
}
this.resizer = new Ext.Resizable(this.el, {
animate: true,
duration: '.6',
easing: 'backIn',
handles: 'all',
pinned: false,
transparent: true
});
this.resizer.on("resize", this.onResizer, this);
},
onResizer: function (oResizable, iWidth, iHeight, e) {
this.setHeight(iHeight);
this.setWidth(iWidth);
}
});
As you can see I am overriding the property. Therefore all the panels that I create have these properties. I don't want it like that.
I know that Ext.extend is the method to use but each time I am getting some errors. What I need is an extended panel with the above code.
Can anybody help me to achieve this?