Grid columns are not resizable when a header row is appended

The following grid columns are not resizable. Is this by design or a bug?

        Grid<Person> grid = new Grid<>();
        grid.setItems(getItems());

        grid.addColumn(Person::getName).setHeader("Name").setResizable(true);
        grid.addColumn(Person::getAge).setHeader("Age").setResizable(true);

        HeaderRow filteringHeader = grid.appendHeaderRow();

Hi!

The problem is that all the “parent headers” (actually <vaadin-grid-column-group> elements) need to be resizable also, and currently we don’t have a component-level API for setting this.

Here’s a quick and dirty workaround:

private void setResizable(Column column) {
    column.setResizable(true);
    Element parent = column.getElement().getParent();
    while (parent != null
            && "vaadin-grid-column-group".equals(parent.getTag())) {
        parent.setProperty("resizable", "true");
        parent = parent.getParent();
    }
}

It needs to be called after creating all the headers and footers.

I created an issue for this: https://github.com/vaadin/vaadin-grid-flow/issues/234

Thank you for reporting!

Thanks Pekka, workaround works great.

its work but horizontal scroll bar show up…