You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most often we are doing server-side sorting (manualSorting: true), with managing the sorting state in the table with column.toggleSorting(). However, we have more complex sorting scenarios, that can't be described with a desc: true/false value (which is only available currently in the ColumnSort interface).
For now we are using a workaround, instead of calling toggleSorting() with a boolean value, we call it with a string, that describes the sorting strategy for the API. This works because toggleSorting can save "anything" to the state, but is quite ugly and also causes a lot of TS errors that we need to handle.
Do you think it would be possible to have a similar approach here as for the column filters, where any arbitrary data can be stored in the columnFilters state, in order to avoid the many TS workarounds?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Most often we are doing server-side sorting (
manualSorting: true
), with managing the sorting state in the table withcolumn.toggleSorting()
. However, we have more complex sorting scenarios, that can't be described with adesc: true/false
value (which is only available currently in the ColumnSort interface).For now we are using a workaround, instead of calling
toggleSorting()
with a boolean value, we call it with a string, that describes the sorting strategy for the API. This works becausetoggleSorting
can save "anything" to the state, but is quite ugly and also causes a lot of TS errors that we need to handle.Do you think it would be possible to have a similar approach here as for the column filters, where any arbitrary data can be stored in the columnFilters state, in order to avoid the many TS workarounds?
Beta Was this translation helpful? Give feedback.
All reactions