PDA

View Full Version : autoExpandColumn and id



Lobos
22 Sep 2009, 11:48 AM
When defining a autoExpandColumn one must add an id attribute to the column model column item:


var grid = new Ext.grid.GridPanel({
store: store,
width: 600,
region:'center',
margins: '0 5 5 5',
autoExpandColumn: 'group',


columns: [
new Ext.grid.RowNumberer(),
{
id: 'group',
header: 'Group',
dataIndex: 'group',
width: 220,
sortable: true,

Is there any reason whey autoexpand can't pick up it's column from the dataindex as opposed to id? Maybe this is because more than one column can have the same data index? idk Or could there at least be a more intuitive warning added if you forget this? Because the error it does give is so cryptic it would turn turing straight...

Thanks...

Lobos
22 Sep 2009, 11:53 AM
and yes I am ranting... sorry

qooleot
22 Sep 2009, 1:50 PM
"Because the error it does give is so cryptic it would turn turing straight..."but the documentation quickly clears that up (I added bold for emphasis):


"The id of a column in this grid that should expand to fill unused space. "I've done the same thing though:} Speaking of common mistakes with the autoExpandColumn:

I often give a width (say 100) and make it autoexpand, but then it shows up with a tiny width (clearly less than 100). I keep forgetting that I also need to set the autoExpandMin. I think the autoexpandcolumn should have a minimum initial width of the defined column width if that is specified and autoExpandMin is not specified...or something like that.