PDA

View Full Version : Hidding a column and its header in a grid



sarsipius
9 Dec 2008, 11:26 PM
Hi,

I would like to know how hidding completely a column in a grid
When I set column.setHidden(true), data in the column don't appeared but the header is still shown and all the remaining columns are shifted

Could you help me to hide the column AND the header?

(I use GWT 1.5.3 and GXT 1.2.0)

sarsipius
10 Dec 2008, 12:51 AM
ok so I think I find an answer :



List<ColumnConfig> configs = null;
ColumnModel cm = null;

[...]
Here I feed my grid and set all the column hidden
[...]

// I want to see this column
configs.get(1).setHidden(false);
cm = new ColumnModel(configs);
grid.reconfigure(store,cm);

cnestor
26 Oct 2009, 11:03 AM
Better to use the existing columnModel to hide the columns:
...
cm.setHidden(1, true);
cm.setHidden(2, false);
....