I am using 7.2.7. I am unable to hide a column in a table with setCollapsed(true). The column is still visible.
Hello @cklee,
unfortunately, I cannot reproduce the problem, Table.Column#setCollapsed() works as expected:
@Inject
private GroupTable<Order> ordersTable;
@Subscribe("collapseColumnBtn")
public void onCollapseColumnBtnClick(Button.ClickEvent event) {
Table.Column<Order> column = ordersTable.getColumn("name");
column.setCollapsed(!column.isCollapsed());
}
Could you provide more information about your problem? Could you share code (controller, screen descriptor) that does not work?
Note that column collapse property is saved in UserSetting. It means if you change this state from UI it will override the value that is set in InitEvent.
In this case, you have the following options:
- use
settingsEnabled="false"in the table; - override
applySettingsin the screen controller; - move your code to
AfterShowEvent.
2 Likes
Thanks. This was what I needed.
CK