Loading...
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.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Opening a new window on clicking of table Header Icon

Vamshi gajam
5 years ago Jul 04, 2016 12:16pm
Henrik Nyman
5 years ago Jul 20, 2016 11:18am
K Timot
5 years ago Nov 07, 2016 8:50pm
K Timot
5 years ago Nov 07, 2016 10:20pm
Olli Tietäväinen
5 years ago Nov 08, 2016 6:51am
K Timot
5 years ago Nov 08, 2016 8:18am
Olli Tietäväinen
5 years ago Nov 08, 2016 8:25am
K Timot
5 years ago Nov 08, 2016 8:48am
Olli Tietäväinen
5 years ago Nov 08, 2016 9:03am
K Timot
5 years ago Nov 08, 2016 10:51am
Olli Tietäväinen
5 years ago Nov 08, 2016 11:09am

Sure. Something like this:

HeaderRow hr = grid.getDefaultHeaderRow();
grid.getColumns().forEach(column -> {
    HeaderCell cell = hr.getCell(column.getPropertyId());
    HorizontalLayout headerCellLayout = new HorizontalLayout();
    Button button = new Button("Hi");
    button.addClickListener(event -> Notification.show("Button pressed"));
    Label label = new Label("I'm a header");
    headerCellLayout.addComponents(button, label);
    cell.setComponent(headerCellLayout);
});