PDA

View Full Version : Column width and forcefit



michaelc
13 Jul 2009, 1:01 PM
I was hoping I would get a simple answer on how to have the columns within a grid expand to fill the grid space.

I find that viewConfig: { forceFit: true } works for IE but not in mozilla or chrome.
also if I wanted to set the size of one or two columns and have the other columns fill the space how would that work.



var UserListGrid = new Ext.grid.GridPanel({
border: false,
height: winHeight - 55,
ds: new Ext.data.Store({
reader: new Ext.data.ArrayReader({}, [{
name: 'name'
}, {
name: 'id'
}, {
name: 'email'
}, {
name: 'onLine'
}]),
data: Ext.grid.userListData
}),
cm: new Ext.grid.ColumnModel([{
header: "Id",
sortable: true,
dataIndex: 'id'
}, {
header: "User name",
sortable: true,
dataIndex: 'name'
}, {
header: "E-Mail id",
sortable: true,
dataIndex: 'email'
}, {
header: "Online",
sortable: true,
dataIndex: 'onLine'
}]),

viewConfig: {
forceFit: true
},
// autoExpandColumn:'name',

tbar: [{
...
}]
});