PDA

View Full Version : Grid align problem in GXT 2.X



planadecu
31 May 2012, 9:33 AM
Hello,

I'm creating a grid with a variable number of columns. The first colum size is 200 and the other are 50.
I can't get a correct grid render. The container is the whole page, so it's big enough. I want the columns give the width of the table.

What am I doing wrong ?



// Grid
ArrayList<ColumnConfig> configs = new ArrayList<ColumnConfig>();


ColumnConfig column = new ColumnConfig();
column.setId(BeanModelData.Field.name.name());
column.setWidth(200);
column.setRowHeader(false);
column.setSortable(false);
column.setMenuDisabled(true);
column.setAlignment(HorizontalAlignment.RIGHT);
configs.add(column);


for (Period period : Period.values()) {
column = new ColumnConfig();
column.setId(period.name());
column.setHeader(loc(period));
column.setRowHeader(true);
column.setWidth(50);
column.setSortable(false);
column.setMenuDisabled(true);
column.setAlignment(HorizontalAlignment.RIGHT);
SpinnerField spinnerField = new SpinnerField();
spinnerField.setIncrement(10);
spinnerField.getPropertyEditor().setType(Integer.class);
spinnerField.getPropertyEditor().setFormat(NumberFormat.getFormat("0.0"));


configs.add(column);
}


final ColumnModel cm = new ColumnModel(configs);
final ListStore<BeanModelData> store = new ListStore<BeanModelData>();
store.add(priceBean.getPricesByPeriod());
final EditorGrid<BeanModelData> grid = new EditorGrid<BeanModelData>(store, cm);
grid.getView().setForceFit(true);
grid.setAutoHeight(true);


container.add(grid);


Thanks,
---
Jordi P.
www.rourevell.com (http://www.rourevell.com)
www.reservango.com (http://www.reservango.com)