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

How to customize sorting on column ? #250

Closed LokeshBoran closed 6 years ago

LokeshBoran commented 6 years ago

By default, sorting is working as (default)=>(asc)=>(desc)=>(default) manner. And in the documentation there is no way to modify sorting default behavior. Like if I want (asc)=>(desc)=>(asc), How to achive it ?

hjalmers commented 6 years ago

So if I understand you correctly you don't want it to be possible to go back to an unsorted state? You can set the initial sort order but a few releases ago I removed the requirement to have the table always being sorted on something so now it will go back to the initial state (although I guess that could be a setting too).

LokeshBoran commented 6 years ago

Yes like other libraries there should be a setting for the same.

hjalmers commented 6 years ago

I've added an option called allowUnsorted which by default is true in v.4.16.0. If set to false sort will switch between ascending and descending were as true will go from descending to unsorted.