I've add a column for a BigDecimal property into the grid and expect that sorting for such column works out-of-the-box:
grid.addColumn(new NumberRenderer<>(dto -> dto.getTotalPrice(), NumberFormat.getCurrencyInstance()))
.setAutoWidth(true)
.setFlexGrow(0)
.setHeader("Summe")
.setSortProperty("totalPrice")
.setSortable(true);
But this doesn't work and I've to provide the comparator
.setComparator((val1, val2) -> val1.getTotalPrice().compareTo(val2.getTotalPrice()))
Maybe similar issue like this one
Addition: If I go without the NumberRenderer and add the column the normal way, then setSortedProperty works as expected:
grid.addColumn(OrderListDto::getTotalPrice, "totalPrice")
.setSortProperty("totalPrice")