mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
BondsView: Fix sorting of numeric columns
The table in the BondsView uses string sorting by default. This results in unexpected behavior when sorting non-string columns. This commit adds custom comparators to the numeric columns to address that. Fixes #3231
This commit is contained in:
parent
bb2484ab3e
commit
12dec2c321
@ -169,6 +169,7 @@ public class BondsView extends ActivatableView<GridPane, Void> {
|
||||
column = new AutoTooltipTableColumn<>(Res.get("shared.amountWithCur", "BSQ"));
|
||||
column.setMinWidth(80);
|
||||
column.getStyleClass().add("first-column");
|
||||
column.setComparator(Comparator.comparingLong(v -> v.getBond().getAmount()));
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(new Callback<>() {
|
||||
@Override
|
||||
@ -189,6 +190,7 @@ public class BondsView extends ActivatableView<GridPane, Void> {
|
||||
tableView.getColumns().add(column);
|
||||
column = new AutoTooltipTableColumn<>(Res.get("dao.bond.table.column.lockTime"));
|
||||
column.setMinWidth(40);
|
||||
column.setComparator(Comparator.comparingInt(v -> v.getBond().getLockTime()));
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(new Callback<>() {
|
||||
@Override
|
||||
@ -287,6 +289,7 @@ public class BondsView extends ActivatableView<GridPane, Void> {
|
||||
|
||||
column = new AutoTooltipTableColumn<>(Res.get("dao.bond.table.column.lockupDate"));
|
||||
column.setMinWidth(140);
|
||||
column.setComparator(Comparator.comparingLong(v -> v.getBond().getLockupDate()));
|
||||
column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));
|
||||
column.setCellFactory(new Callback<>() {
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user