Visualise the initial sort state, and disable sort for specific columns
olliejm opened this issue · comments
When I click on a column to sort it, an arrow appears indicating the sort direction.
I'm missing a way to ensure that this arrow is present initially when a sort is pre-applied, there doesn't appear to be any sortable
, sorted
or sortDirection
or similar props on the Column
type to provide information about the initial state, before the table is interacted with. My remote data query however has a default sort, and it would be ideal if I could reflect that in the UI
Just FYI I'm using SortingMode.SingleRemote
.
I'm also not sure how to disable sorting on a specific column - I have some columns which should not be sortable within a table of otherwise sortable columns. I saw this comment suggesting not to dispatch the props change, but that seems to completely prevent all sorting from the point that the non-sortable column is interacted with onwards.
Hi @olliejm there is ‘sortDirection’ property for the column
Docs https://ka-table.com/docs_props.html#toc1
Demo https://komarovalexander.github.io/ka-table/#/sorting
“I'm also not sure how to disable sorting on a specific column - I have some columns which should not be sortable within a table of otherwise sortable columns. I saw #162 (comment) suggesting not to dispatch the props change, but that seems to completely prevent all sorting from the point that the non-sortable column is interacted with onwards.”
I think the best way is to add one more property to column ‘isSortable’ - I can do it later, probably this week.
but for now you can wrap the reducer https://ka-table.com/docs_reducer.html#toc2
or prevent the headerCell onClick using the childComponents
Thanks. I missed the sortDirection somehow
column.isSortable
was added in v7.6.0
details here: https://github.com/komarovalexander/ka-table/releases/tag/7.6.0