dash-table
dash-table copied to clipboard
Changing first click on sort arrow behavior
Hello everyone, and thank you for the effort you put into the whole Dash project. It is a really amazing tool which seems to keep getting better very fast!
I just wanted to suggest a feature which started as a question on the forums: Being able to change the first sorting strategy applied per column on datatables.
As stated on the question, right now the first click on the sorting arrow applies an ascending sort with that column, the second one does a descending sort and the third one just clears the sorting.
So even if this isn't a blocker for anything, I think it would be a good quality of life feature to be able to change this first sorting strategy, preferably per column, passing a list of dicts like with the columns
parameter. I think this is likely to make users who deal with rows with creation dates which are more likely to be sorted in descending order a bit more happy 😄
I could look into this myself if you think it could be useful as well as a suitable task for a newcomer, as I've always been a bit interested in going deeper into Dash but haven't found an excuse to do so.
Thanks for your time!
Thanks @Jendoliver - I think this would be a really nice feature, we'd happily accept a PR to add it!
I'm thinking the best thing to model it after would be sort_as_null
- which exists both as a top-level prop and nested inside columns
. Perhaps sort_priority: ('ascending'|'descending')
?
Agreed, that makes much more sense. And the property name sounds good to me as well!
I'll give this a shot, thanks for your input! 👍
Was also looking for this feature and ended up here. Curious if this was ever implemented?