Auto width in a BorderLayout panel

2.5k views Asked by At

I am trying a implement a really simple layout using BorderLayout.

 var summary = new Ext.Panel({
    region:'west',
    id:'summary',
    title:'Summary layout',
    header: true,
    split:true,
    collapseMode: 'mini',
    collapsible: true,
    width: 200,
    minSize: 175,
    maxSize: 400,
    layout:'vbox',
    align: 'stretch',
    items: [{
        html: Ext.example.shortBogusMarkup,
        title:'Navigation',
        autoScroll:true,
        border:false,
        flex: 1
    },{
        title:'Settings',
        html: Ext.example.shortBogusMarkup,
        border:false,
        autoScroll:true,
        iconCls:'settings',
        flex: 1
    }]
  });

The layout renders well, but when I change the width using the handle, the two panels inside the vbox don't resize.

I tried any kind of configuration I thought of, but i did not work.

(layout fit, width auto, autoWidth, etc...)

What do I miss? Thanks

2

There are 2 answers

1
Jonas Schmid On BEST ANSWER

I finally found by myself.

I set the layout options not correctly

I had to change to

...
    layout:'vbox',
    layoutConfig: {
      align: 'stretch'
    },
    items: [{
...
0
dblv On

For me, it doesn't work. But this code works :

layout:{
    type:'vbox',
    align:'stretch'
}