GXT Grid Column Alignment

How to align GXT grid column?
Answer : it can be done at ColumnConfig.
Here is sample code :

List configs = new ArrayList();

ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("Company");
column.setWidth(200);
configs.add(column);

column = new ColumnConfig();
column.setId("symbol");
column.setHeader("Symbol");
column.setWidth(100);
configs.add(column);

column = new ColumnConfig();
column.setId("last");
column.setHeader("Last");
column.setAlignment(HorizontalAlignment.RIGHT);
column.setWidth(75);
column.setRenderer(gridNumber);
configs.add(column);

column = new ColumnConfig("change", "Change", 100);
column.setAlignment(HorizontalAlignment.RIGHT);
column.setRenderer(change);
configs.add(column);

The full example can be found here :
http://www.java2s.com/Code/Java/GWT/SetcolumnalignmentnameandheightExtGWT.htm

0 comments:

 
Copyright © peyotest