I searched on SO, but only found posts regarding sorting TreeView
, e.g.,
JavaFX: TableView: Arrow for a column sorted by default and Javafx: Re-sorting a column in a TableView.
Both don't seem to work with my TreeTableView
.
Also Oracle's blog post on Tree Table Views (see Example 15-4: Sorting Mode Settings) does not really help.
I think it should be some combination of
row.setSortType(...)
and
table.setSortMode(...)
and
table.sort()
and
table.getSortOrder(). ...
and
table.getSortPolicy(). ...
yet I could not get it working.
What I want to achive:
- Define columns & add them to the table (Works fine)
- Set default sort (e.g., sort data by "
valueColumn
" descending) (How?) - Set root (Works, but does not get sorted at the moment)