View Full Version : Widening problem for grid last column

25 Jun 2010, 7:04 AM

For grids which don't have many rows, or more precise, which they don't have a vertical scrollbar, is close to impossible to widen the last column.

Have a look at the example http://www.sencha.com/examples-dev/explorer.html#jsongrid, and try to enlarge ZipCode column, without loading the data.

Does anyone have any idea how to make life easier for the client on this case?


28 Jun 2010, 4:18 AM
can this be put as a bug? "right most column from grid can't be enlarged"

28 Jun 2010, 4:22 AM
I added it to the list, however the chance to get it fixed for 2.X is not very high.

This is how it is designed. Resizing can only be done within the gridcontainer

28 Jun 2010, 4:31 AM
ok, thank you for the reply

28 Jun 2010, 6:31 AM
For those who needs a quick fix for this issue, here is a possible solution.

The code that restricts the resizing of the column to the width of the grid is located in ColumnHeader.onDragStart() (line 115)

int maxx = (container.el().getX() + container.el().getWidth()) - e.getEvent().getClientX();
d.setXConstraint(minx, maxx);
I've increased the maxx value, which constraints the width of the column, with the wished amount. Each time the user draggs a column, he will be able to add another EXTRA_COLUMN_WIDTH pixels to the width.

PS: a more straithforward solution is to modify ColumnHeader.onDragEnd - int endX = e.getClientX(). the previous solution needs also to set d.setContraintClient(false), otherwise you are limited by the width of the browser.