PDA

View Full Version : Appling Ext.Resizable to Ext.Panel



savsw
9 Sep 2010, 1:13 AM
Hello,

Please give an example, how can I archive this?
For example, I create portlet as:


Ext.ux.Portlet = function(cfg){
// overwrite configuration
var cfg = Ext.apply (cfg||{},
{
anchor : '100%',
frame : true,
collapsible : true,
draggable : true,
cls : 'x-portlet', //,
autoScroll: true,
autoWidth: false
/*
layoutConfig: {
animate:false
},

shim:false,
animCollapse:false,
*/
});
Ext.ux.Portlet.superclass.constructor.call(this,cfg);
};

Ext.extend(Ext.ux.Portlet,Ext.Panel,{} );

Ext.reg('portlet', Ext.ux.Portlet);


Can I apply resizable to this class?

osmancorp
9 Sep 2010, 2:24 AM
Ext.ux.Portlet = function(cfg){
// overwrite configuration
var cfg = Ext.apply (cfg||{},
{
anchor : '100%',
frame : true,
collapsible : true,
resizable: true,
draggable : true,
cls : 'x-portlet', //,
autoScroll: true,
autoWidth: false
/*
layoutConfig: {
animate:false
},

shim:false,
animCollapse:false,
*/
});
Ext.ux.Portlet.superclass.constructor.call(this,cfg);
};

savsw
9 Sep 2010, 4:10 AM
It did not help.
I expect it would work if I extend from Ext.Window, but not from Ext.Panel.

Please help!!!)))

Condor
10 Sep 2010, 2:26 AM
You will need to create an Ext.Resizable for the Panel el in the afterrender event of the panel.

In the resizable you will need to hook up the resizeElement method to resize the panel instead of only the el (have a look at the source how Ext.Window does this).

savsw
12 Sep 2010, 8:08 PM
Hello,

I used the solution from the following thread:
http://www.sencha.com/forum/showthread.php?84931-Ext.Resizable-not-working-correctly-in-IE6-on-Panel

It helped. In Ext.Window there is too much code concerning resizing:)