Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 2 weeks ago
Grid - Show/Hide Grouped Header Row
Grid grid = new Grid(container);
grid.removeAllColumns();
grid.setWidth(100, Unit.PERCENTAGE);
layout.addComponent(grid);
grid.addColumn("firstName");
grid.addColumn("company");
grid.addColumn("age");
grid.addColumn("dummy1");
grid.addColumn("dummy2");
grid.setColumnOrder("company", "firstName", "age", "dummy1", "dummy2");
Grid.HeaderRow groupingHeader = grid.prependHeaderRow();
Grid.HeaderCell column1 = groupingHeader.join( groupingHeader.getCell("firstName"), groupingHeader.getCell("company"));
column1.setText("first");
Grid.HeaderCell column2 = groupingHeader.join( groupingHeader.getCell("age"), groupingHeader.getCell("dummy1"), groupingHeader.getCell("dummy2"));
column2.setText("second");
grid.setColumnReorderingAllowed(true);
grid.getColumns().forEach( c -> c.setHidable(true));
i am trying to work with the Grid controls.
I am able to show/hide the individual columns by setting the setHideable() property of the Column , but i would like to show/hide the grouped columns .
I was trying to add the visibilitychange handler of grid controls but am unable to get the reference of the grouped header.
Is there a way to do it?
Last updated on
You cannot reply to this thread.