PDA

View Full Version : Autoresizing of child panel in border layout



evgenspb
24 Jan 2013, 2:26 AM
Hello,

I have easy border layout.
I have collapsed panels in west panel.
I can change width of west panel by splitter.

The problem is that system does not fire resize event all type when I resize west region. (Chrome+FF under ubuntu x64 10.04 tested)

Is it bug or my mistake?

The problem can be solved id I catch resize event at west panel end call doLayout method.

(green code if my patch)


var viewport = Ext.create('Ext.Viewport', {

layout: {
type: 'border',
padding: 5
},
defaults: {
split: true
},
items: [{
region: 'north',
collapsible: false,
title: 'North',
height: 100
},{
region: 'west',
collapsible: true,
title: 'West',
width: 150,
listeners:{
resize: function(o) {
o.doLayout();
}
},
items: [{
collapsible: true,
padding: 1,
border: 1,
title: "Menu1",
items: {
xtype: 'menu',
floating: false,
border: 0,
items: [{
text: 'sfdsf'
},{
text: 'gfngfnjgfnrgf'
}]
}
},{
collapsible: true,
padding: 1,
border: 1,
title: "Menu2",
items: {
xtype: 'menu',
floating: false,
border: 0,
items: [{
text: 'sfdsf'
},{
text: 'gfngfnjgfnrgf'
}]
}
}]
},{
region: 'center',
collapsible: false,
html: 'west'
}]
});