PDA

View Full Version : Resizable by windows.onresize



Osman84
2 Jul 2010, 7:42 AM
Hi,

i have a panel with BorderLayout with a listener, which resize the hole panel.

My Question ist, how can i resize the panel by changing the windows-size "windows.onresize"?

My Code:

Ext.onReady( function(){
panel = new Ext.Panel({
title: 'TItle',
xtype: 'panel',
height: 500,
border: true,
layout: 'border',
renderTo: 'pageContainer',
listeners: {
render: function(p) {
new Ext.Resizable(p.getEl(), {
handles: 'all',
pinned: true,
transparent: true,
resizeElement: function() {
var box = this.proxy.getBox();
p.updateBox(box);
if (p.layout) {
p.doLayout();
}
return box;
}
});
}
},
items: [{
title: 'South Panel',
region: 'south',
height: 100,
style: 'color: red',
collapsible: true,
split: true,
autoScroll: true,
stateful:true,
stateId:'state_south',
margins: '0 5 5 5',
items: [{
contentEl: 'south',
border: false
}]
},{
title: 'East Panel',
region: 'east',
style: 'color: red',
margins: '5 5 0 0',
collapsible: true,
width: 350,
autoScroll: true,
split: true,
stateful:true,
stateId:'state_east',
items: [{
contentEl: 'east',
border: false
}]
},{
title: 'Main Content',
region: 'center',
style: 'color: red',
titleCollapse: true,
split: true,
collapsible: true,
autoScroll: true,
margins: '5 0 0 5',
items: [{
contentEl: 'center',
autoScroll: true,
border: false
}]
}]
})
});

Thanks,
Osman

Condor
2 Jul 2010, 7:52 AM
You mean you want to resize the panel when the window resizes? But you also have a Resizable attached to the panel, so I don't see how that could work together.

ps. Could it be that you are looking for the FitToParent plugin?

4 Jul 2010, 9:01 AM
You mean you want to resize the panel when the window resizes? But you also have a Resizable attached to the panel, so I don't see how that could work together.

ps. Could it be that you are looking for the FitToParent plugin?

Agreed. Seems like a use case destined for fail :(