How to set width in Ext.grid.ColumnModel
in percentage terms?
Use numbers for the column widths with a total of 100 and configure the view with forceFit, e.g.
var grid = new Ext.grid.GridPanel({
cm: new Ext.grid.ColumnModel({
columns: [{
header: 'header1',
dataIndex: 'data1',
width: 30
},{
header: 'header2',
dataIndex: 'data2',
width: 30
},{
header: 'header3',
dataIndex: 'data3',
width: 40
}]
}),
viewConfig: {
forceFit: true
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With