ExtJS Gridpanel Column width + forcefit

gberg927 picture gberg927 · Dec 15, 2011 · Viewed 15.2k times · Source

I have a gridpanel that i would like to have 2 columns in. I want the first column to have a width of 100 and the second column to fill the remaining width in the gridpanel.

Any ideas?

EDIT

sensorListPanel = new xg.GridPanel({
    id: 'sensorListPanel',
    region: 'west',
    width: 415,
    viewConfig: {
        forceFit:true,
        //fitcontainer:true
    },
    store: sensorStore,
    cm: new xg.ColumnModel({
        defaults: {
            width: 120,
            sortable: true
        },
        columns: [
            smSensors,
            {id:'Station',header: "Station", width: 95, dataIndex: 'gml_id'},
            {id:'Description', header: "Description", dataIndex: 'description'}
        ]
    }),
    sm: smSensors,
    columnLines: true,
    title:'Sensors',
});

Answer

MMT picture MMT · Dec 15, 2011

try setting forceFit in viewconfig

viewConfig:{forceFit:true}

By specifying forceFit:true, non-fixed width columns will be re-proportioned (based on the relative initial widths) to fill the width of the grid.