Franz4
(Franz Schoning)
June 16, 2018, 10:00am
1
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();
Pekka29
(Pekka Maanpää)
June 18, 2018, 11:49am
2
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!
Franz4
(Franz Schoning)
June 18, 2018, 12:08pm
3
Thanks Pekka, workaround works great.
Rafal28
(Rafal Kozyra)
June 12, 2019, 8:41am
4
its work but horizontal scroll bar show up…