Viacheslav-Radchenko/TSTableView

Add sorting indicator and clicable header

kronik opened this issue · 1 comments

Hi,

How hard it is to add a sorting to this tableview? Basically need just an indicator in the header and block/delegate method to sort model data.

Hi,

At present moment you can look on this method in data source implementation

  • (TSTableViewHeaderSectionView *)tableView:(TSTableView *)tableView headerSectionViewForColumnAtPath:(NSIndexPath *)indexPath

possibly subclass from TSTableViewHeaderSectionView and provide additional control item for sorting with proper callback (perform reloadRowsData here).

Or do sorting on column selection event:

  • (void)tableView:(TSTableView *)tableView willSelectColumnAtPath:(NSIndexPath *)columnPath animated:(BOOL)animated;

Let me know if this helps or you need something more specific, I will think how it can be added to base functionality.