Hello!
We are using Vaadin 14.1.5.
We have got a grid and want to sort the second column by default:
We wrote following code:
final com.vaadin.flow.component.grid.Grid.Column column0 = grid
.getColumns().get(1);
final java.util.ArrayList<com.vaadin.flow.component.grid.GridSortOrder<de.tricept.vaadin.services.mcockpit.TableDataRow>> sort = new java.util.ArrayList<com.vaadin.flow.component.grid.GridSortOrder<de.tricept.vaadin.services.mcockpit.TableDataRow>>();
final com.vaadin.flow.component.grid.GridSortOrder<de.tricept.vaadin.services.mcockpit.TableDataRow> order = new com.vaadin.flow.component.grid.GridSortOrder<de.tricept.vaadin.services.mcockpit.TableDataRow>(
column0, com.vaadin.flow.data.provider.SortDirection.ASCENDING);
sort.add(order);
grid.sort(sort);
All is fine. The grid sorts header of second colum is marked blue and the right sort arrow is highlighted.
But there is a problem: Whe we click on anonther column header to sort this one we have got to click twice.
After the second click sorting goes on.
Why we have got to click two times?
Thank you very much,
Thomas