TableView: add ability to sort by function