My TableView populates data from database. When user clicks a column header, it sort the data based on it. This feature is out of the box. However, I have too many records to populate them at a time. Say I have 1000 records and the table only shows 500. When I sort it based on a column, it only shorts the 500 already populated record.
I'd like to override the sorting behaviour so when user clicks a column header, it will reload the data from database and provide necessary information for "order by" clause in the query. My problem is, I don't know
- How to turn off existing sorting behaviour. I can set column's sortable property to false, but I'm afraid it makes the header not clickable.
- How to attach listener to listen to column header click event. Is tableView.getSortOrder().addListener() the right way?