jdolan / ObjectivelyMVC

Object oriented MVC framework for OpenGL, SDL2 and GNU C. Inspired by Apple's AppKit. Zlib license.
Other
29 stars 7 forks source link

Table sorting creates data inconsistency #18

Closed jdolan closed 7 years ago

jdolan commented 7 years ago

TableView sorts its rows by the sortColumn's Comparator. When this happens, the rows are then at different indices than what the TableViewDataSource provided them at. When row selection occurs after sorting, the indices the delegate receives are incorrect / useless.

What should happen instead, is what NSTableView does: that is, the delegate should be extended to include a didSetSortColumn callback, where the caller can sort the backing data set, and call $(tableView, reloadData) when done.

I'm working on this now; just wanted to capture it via issue. CC @kaadmy

jdolan commented 7 years ago

This is now fixed. Sorting happens "client side".