samedi 12 avril 2014

Undesired Column Resize in Grids

I have a problem where sometimes and umpredictably the columns on grids get resized when the grid is shown again.

Here is the before picture:

Before.png


Here's the after:


After.jpg


I have a dialog with a three column grid. The first few times I show the dialog, the columns are the sizes that I assigned to them. But after a few views the grid columns resize as shown.


Here is the code I use to create it:



Code:



Grid<PossibleName> grid;


ColumnConfig<PossibleName, String> cc1 = new ColumnConfig<PossibleName, String>(properties.name(), 220, UI.i18n.name());
ColumnConfig<PossibleName, String> cc2 = new ColumnConfig<PossibleName, String>(properties.type(), 70, UI.i18n.type());
ColumnConfig<PossibleName, String> cc3 = new ColumnConfig<PossibleName, String>(properties.summary(), 130, UI.i18n.summary());


List<ColumnConfig<PossibleName, ?>> l = new ArrayList<ColumnConfig<PossibleName, ?>>();
l.add(cc1);
l.add(cc2);
l.add(cc3);


ColumnModel<PossibleName> cm = new ColumnModel<PossibleName>(l);


grid = new Grid<PossibleName>(store, cm);
grid.getView().setAutoExpandColumn(cc1);




Aucun commentaire:

Enregistrer un commentaire