Externally controlled sort improvements #2377
Unanswered
adam-thomas-privitar
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, the sort hook provides a way to have sort from an external source, like an API by activating the
manualSortBy
option. However, I think this doesn't go far enough since if the state of the sort is externally provided, it means ideally:onSortChanged
.This way the sort state can be fully controlled which makes more sense than uncontrolled in these cases.
For columns in controlled mode, the hooks function would be a lot simpler, and would just map through the sort state passed through the useTable hook args and. also the click handler. This would be decided on a per column level, maybe using a column option like
sortControlled
or something. Arguably you could mix both controlled (api powered) and uncontrolled (client side) sorts simultaneously.Beta Was this translation helpful? Give feedback.
All reactions