I have 5 columns in my table, and how is it possible to make one of the columns invisible? is it any standard approach for that, or maybe, can I use css for that?
Asked
Active
Viewed 2,010 times
2 Answers
3
You need to allow column collapsing in your table
table.setColumnCollapsingAllowed(true);
After that, you can collapse or hide any column
table.setColumnCollapsed("columnId", true);
An example:
FilterTable table = new FilterTable("The Brightest Stars");
// Define two columns for the built-in container
table.addContainerProperty("Name", String.class, null);
table.addContainerProperty("Mag", Float.class, null);
// Allow column collapsing
table.setColumnCollapsingAllowed(true);
// Hide column "Name"
table.setColumnCollapsed("Name", true);

Víctor Gómez
- 724
- 6
- 23
-
but no, it doesnt work) I mean user still can make it visible) And user shouldnt be able to make it visible – vlcod Dec 04 '15 at 14:02
1
In case you just don't want to show them at all, use setVisibleColumns on the Table:
public void setVisibleColumns(java.lang.Object... visibleColumns)
Sets the array of visible column property id:s.
The columns are show in the order of their appearance in this array.
Parameters:
visibleColumns
- the Array of shown property id:s.
(also setContainerDataSource
) allows passing the visisible columns)

cfrick
- 35,203
- 6
- 56
- 68
-
yes, but I need to have it in the table, because I use it when I double click on one of the records... – vlcod Dec 07 '15 at 08:17
-
and if it's not in the table, so, I can use this value for further processing – vlcod Dec 07 '15 at 08:17
-
-