PDA

View Full Version : Grid Column Sizing Problem



JeffBurr
26 Sep 2007, 12:25 PM
[SOLVED - But Buggy]
This problem is caused by having columns that have a number as their ID in the ColumnModel of the grid. This has something to do with the multiple levels of CSS that gets appplied to the grid, which use the column ID if you have one. Apparently, there is a problem with CSS and classes that begin with a number(?) - at least with regrad to width...

So, the lesson is: don't use numbers as column ID!

*****************
I have a grid and all is well. Until I add a column that uses a date renderer:


},{
header: "Start",
dataIndex: 'StartTime',
width: 70,
sortable: true,
renderer: Ext.util.Format.dateRenderer('h:i A')
},
...etc
{

Now the column headers in the grid have widths that don't match the rest of the grid. It is something to do with the renderer, since it is this column that is off.

Any suggestions would be appreciated!

[SOLVED - But Buggy]

JeffBurr
26 Sep 2007, 12:28 PM
It is basically ignoring the 'width' parameter in the code above. The column header is correct, but no matter what I set this width to, the column for data in the grid is 66px - or just big enough to fit the rendered data.

jeffiel
26 Sep 2007, 1:38 PM
What browser? All?

JeffBurr
26 Sep 2007, 3:38 PM
I am using IE6 and FF2

kei
27 Sep 2007, 4:05 AM
Watch out for grid config autoExpandColumn and autoSizeColumns.

JeffBurr
27 Sep 2007, 5:38 PM
I tried several different scenarios with these two params and couldn't get any solution...

Any other thoughts? HELP!

kei
27 Sep 2007, 8:57 PM
I meant that the two configs causes the automatic column resizing.
You can set autoSizeColumns: false and remove autoExpandColumn, provided that you specify the width of each column in the ColumnModel.