Vaadin 8.1.1 Grid sort listener implementation

I’m implementing grid ui on vaadin 8.1.1 and I added sortListener for the grid.

There is a column called “ID” and it is hidden.

When the grid is sorted, I want to reassign its “ID” from 1 to n based on the sorted order.

Is there any way I can access the sorted data?

Thanks in advance !

Not in a nice way, I think. Only thing that comes to mind is getting the DataCommunicator of the Grid and recreating the sort based on that.


There is method one method in DataCommunicator that could help. It is the fetchItemsWithRange(…), which gives you items after sorting and filtering. However you need to upgrade to 8.2.0.beta1 in order to use it.