PDA

View Full Version : Resizing grid panel causes column resizing issue.



clucernoni
22 Aug 2012, 6:29 AM
I have a GridPanel that looks fine when it is rendered. I set up the columns to expand and contract with the GridPanel size and it NORMALLY does this just fine. But when I make the GridPanel very small (see "during.jpg" image), and then expand it back out to normal size, The "source" column is now very small and cutoff. All the other columns resized just fine, but it is always the last column in the GridPanel that is not "fixed: true". The GridPanel sits inside a viewport. Any ideas?

Note: I had to trim some of the code down as this GridPanel does many other things. The syntax is correct and work, so if there is a semi-colon or "(" missing, I just copied/cut/pasted wrong here. Thanks!


new Ext.Viewport ({
layout:'border',
id:'viewport',
items:[
westPanel,
new Ext.Panel({
region:'center',
layout:'border',
items:[docListGrid, docViewerPanel]
})
]
});


Ext.applyIf(config, { id:'thisGrid',
region:'north',
split:true,
height: 150,
viewConfig:{getRowClass: getRowClass, forceFit:true},
columns:[{
fixed: true,
renderer: function(){},
width: 1,
menuDisabled: true
},{
header:'DSC Ingest Date',
dataIndex: 'documentCreatedOn',
renderer:function(val, meta, record, rowIndex, colIndex, store){
return new Date(val).toString();
},
menuDisabled:true,
sortable: true
},{
header:'Subject',
dataIndex: 'Subject',
menuDisabled: true,
sortable: true,
renderer:function(val, meta){
meta.attr = 'style="white-space:normal"';
return val;
}
},{
header:'Classification',
dataIndex: 'SecurityLabel',
menuDisabled: true,
sortable: true
},{
header:'Source',
dataIndex: 'Source',
menuDisabled: true,
sortable: true,
width: 50
}],
store: new Ext.data.JsonStore({
fields:['ExternalID', 'documentCreatedOn', 'Subject', 'SecurityLabel', 'Source', 'Activity Time', 'unread']
})

38153
38154
38152

scottmartin
22 Aug 2012, 8:40 AM
You have a width of 50, so it takes this size, and the others listen to your forcefit.
Remove the forcefit and use flex: 1 for the columns that you want to change on resize.

Scott.