-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed sorting in views with TableView instances with no implemented sort #3319
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -312,6 +312,9 @@ public void updateItem(final MyReputationListItem item, boolean empty) { | |
} | ||
}); | ||
tableView.getColumns().add(column); | ||
column.setComparator(Comparator.comparing(MyReputationListItem::getAmount)); | ||
column.setSortType(TableColumn.SortType.ASCENDING); | ||
tableView.getSortOrder().add(column); | ||
Comment on lines
+315
to
+317
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again pointless defining a string to be sorted for as it is the default behavior. |
||
|
||
column = new AutoTooltipTableColumn<>(Res.get("dao.bond.table.column.lockTime")); | ||
column.setMinWidth(60); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,6 +157,9 @@ public void updateItem(final RolesListItem item, boolean empty) { | |
}; | ||
} | ||
}); | ||
column.setComparator(Comparator.comparing(RolesListItem::getLockupDate).reversed()); | ||
column.setSortType(TableColumn.SortType.ASCENDING); | ||
tableView.getSortOrder().add(column); | ||
Comment on lines
+160
to
+162
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you sorting this based on lockup date if the name is displayed without any date information displayed. This just makes it confusing for the user. |
||
tableView.getColumns().add(column); | ||
|
||
column = new AutoTooltipTableColumn<>(Res.get("dao.bond.table.column.link")); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,8 @@ | |
|
||
import static bisq.desktop.util.FormBuilder.addButtonAfterGroup; | ||
|
||
import java.util.Comparator; | ||
|
||
@Slf4j | ||
public class ProposalResultsWindow extends TabbedOverlay<ProposalResultsWindow> { | ||
|
||
|
@@ -249,6 +251,9 @@ public void updateItem(final VoteListItem item, boolean empty) { | |
}; | ||
} | ||
}); | ||
column.setComparator(Comparator.comparing(VoteListItem::getBlindVoteDate)); | ||
column.setSortType(TableColumn.SortType.DESCENDING); | ||
votesTableView.getSortOrder().add(column); | ||
votesTableView.getColumns().add(column); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has no effect as the columns are not sortable right now. |
||
|
||
column = new AutoTooltipTableColumn<>(Res.get("shared.blindVoteTxId")); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change the default sort order to amount. Atm it is sorted by lockup date and it should stay like that. And all this doesn't work at all as desired as you have applied sorting to a string value which is the default behavior.