PDA

View Full Version : Grid column resizing



shav
13 Aug 2013, 1:13 AM
Hi All,

I'm trying to create a grid with resizable columns.
Each column has a 'flex' config, also the grid has it's 'layout' set to 'fit'. As a result I get a grid with resizable columns but each column resize action (especially column width enlarging action) causes other columns to re-calculate width. What I need is columns which resize without affecting other colums' width.

I should say that forceFit config set to true does not help. It makes a mess after resizing any column.
Also when I set a fixed width to grid, it seems that the issue is gone until I reach the maximum width of column. As I've noticed the width is set to 1000px.

Here's the example code:

var grid = Ext.create('Ext.grid.Panel', {
store: store,
columns: [
{
text : 'Company',
width : 75,
dataIndex: 'company'
},
{
text : 'Price',
flex : 1,
sortable : true,
dataIndex: 'price'
},
{
text : 'Change',
width : 75,
dataIndex: 'change'
},
{
text : '% Change',
width : 75,
dataIndex: 'pctChange'
},
{
text : 'Last Updated',
width : 85,
renderer : Ext.util.Format.dateRenderer('m/d/Y'),
dataIndex: 'lastChange'
}
],
layout: 'fit',
title: 'Array Grid',
renderTo: Ext.getBody(),
viewConfig: {
stripeRows: true,
enableTextSelection: true
}
});


I'd like to know is there a way to achieve resizing one column without resizing others. Or at least please let me know if there is a way to change the max width of columns set to 1000px.

Thanks in advance.

shav
13 Aug 2013, 5:22 AM
I re-wrote the same code under Ext 4.2.0 and it worked as I expected (i.e. each column resizes affecting only it's size and size of it's right neighbour). Could you please provide code changes you have made for that feature so that I can put them in Ext 4.1.1 code?

Gary Schlosberg
15 Aug 2013, 9:57 AM
There were quite a number of changes to grids between 4.1 and 4.2. It could prove difficult to separate out this particular fix. I know that there was an issue with column resizing related to forceFit, but don't know the nature of all of the related code fixes and how they affect any other grid bugs fixed in that release.