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.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Vaadin 8 grid change column order
Hi. I create grid with columns. See photos attached. But in some cases it must start with Friday, Saturday..., in other cases Monday, Tuesday etc. Give me advice how to implemented it.
There is method Grid#setColumnOrder()
for this. You need to either have Column
references or ids there. You can set them when building the Grid
.
One other straightforward way could be that you use Grid with class parameter, so that it picks the property names. I.e. Grid<Bean> grid = Grid<>(Bean.class, false);
After that you can call grid.setColumns("friday","saturday", ...)
or grid.setColumns("monday","tuesday", ...)
thanks. But I have another columns no to be altered. But after code changes order of columns changes too.
. But after code changes order of columns changes too.
You naturally need to have the invariant columns in setColumns too, e.g. grid.setColumns("week","exhibitor","site","movie","friday","saturday", ...)
or grid.setColumns("week","exhibitor","site","movie","monday","tuesday", ...)