PDA

View Full Version : grid size of header



beab1802
4 Mar 2009, 6:31 AM
I think there are a bug with the grid header. The header of my grid was not synchronized with the grid of data. After many tests, I found this way. When they are column size very small like 20px, my header is not synchronized with the rest of the data. At size 30px that Ok.

I send this thread because I take lot of times for find what is wrong. Maybe can I help some others persons with this problem. I can send code sample if you wish, but I think, it's not necessary.


public void setGridQ() {
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

ColumnConfig column = new ColumnConfig();
column.setId("libelle");
column.setHeader("Question");
column.setMenuDisabled(true);
column.setSortable(false);
configs.add(column);

column = new ColumnConfig();
column.setId("a");
column.setHeader("a");
column.setMenuDisabled(true);
column.setWidth(20);
column.setAlignment(HorizontalAlignment.RIGHT);
column.setSortable(false);
configs.add(column);

column = new ColumnConfig();
column.setId("b");
column.setHeader("b");
column.setMenuDisabled(true);
column.setWidth(20);
column.setAlignment(HorizontalAlignment.RIGHT);
column.setSortable(false);
configs.add(column);

column = new ColumnConfig();
column.setId("c");
column.setHeader("c");
column.setMenuDisabled(true);
column.setWidth(20);
column.setAlignment(HorizontalAlignment.RIGHT);
column.setSortable(false);

configs.add(column);

column = new ColumnConfig();
column.setId("d");
column.setHeader("d");
column.setMenuDisabled(true);
column.setWidth(20);
column.setAlignment(HorizontalAlignment.RIGHT);
column.setSortable(false);
configs.add(column);

column = new ColumnConfig();
column.setId("statistiques");
column.setHeader("statistiques");
column.setMenuDisabled(true);
column.setAlignment(HorizontalAlignment.RIGHT);
column.setWidth(100);
column.setSortable(false);
configs.add(column);

ListStore<Question> store = new ListStore<Question>();
store.setMonitorChanges(true);
ColumnModel cm = new ColumnModel(configs);

gridQ = new Grid<Question>(store, cm);
gridQ.setAutoExpandColumn("libelle");
gridQ.setStyleAttribute("borderTop", "none");
gridQ.setBorders(true);
}

The first attachment is not synchronized and the second is synchronized. Also, I find than the column.setAlignment as a role too. In the first case the alignment is at RIGHT and the second is CENTER.

In resume, when the column size is too small and the alignment is RIGHT, the header is not synchronized with the data.


Bernard

sven
4 Mar 2009, 6:34 AM
You need to post your code and also a screenshot if that is possible. I dont see any issue there.