hjalmers / angular-generic-table

A generic table for Angular 2+. Generic table uses standard markup for tables ie. table, tr and td elements etc. and has support for expanding rows, global search, filters, sorting, pagination, export to CSV, column clicks, custom column rendering, custom export values.
https://hjalmers.github.io/angular-generic-table/
MIT License
105 stars 55 forks source link

No way to disable standard sorting by first column #230

Closed beerran closed 6 years ago

beerran commented 6 years ago

There is currently no way to disable the standard sorting on the first column. Currently using a workaround by adding $$gtRowId to gtFields and gtSettings (hidden) and sorting by that key, as the index is correct. Afterwards, we remove it from the genericTable that's being sent into GtColumnSettings to hide it from the user when toggling column order/visibility.

hjalmers commented 6 years ago

@beerran the last release v4.14.0 should fix this. The table now uses the original sort order of the data array initially and when sorting is applied it goes from enabled (original) => ascending => descending and then back to the original sort order if unsorted.