[Feature Request] Add option to VDataTable for Disable Sorting
See original GitHub issueNew Functionality
The DataTable component always sorts the first column if no other sorting config is passed. This adds extra client-side work, even if/when the assumption is correct.
I should be able to pass a default-sort="false"
to the table, to let the data show exactly as it was received.
Here is a minimal representation of the behavior: https://codepen.io/lukeed/pen/MOYwEL
The feature is definitely a nice-to-have, but I should be able to opt out of it when needed, and without needing to provide an alternative sorting method.
Improvements
I should expect to see table rows in the order that my service returned. This also removes the need to have prior knowledge of how the external data will be pre-sorted and returned to me.
Bugs or Edge Cases it Helps Avoid
It allows me to render data exactly as it was received. It also prevents extra/unnecessary client-side sorting calculations. The sorting function takes place even if the rows are pre-sorted by first column value too.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top GitHub Comments
Edit: Never mind, in reading this again, I think you’re just suggesting that you don’t want any pre (default) sort – not that you want to disable sorting altogether.
Original comment: In searching for a very similar thing, I ran across: https://github.com/vuetifyjs/vuetify/issues/442
I think it will provide a solution to what you’re looking for. Setting all the headers to sortable: false, like:
seems to completely disable the sort. Hope it helps!
We kindly ask users to not comment on closed/resolved issues. If you believe that this issue has not been correctly resolved, please create a new issue showing the regression or reach out to us in our Discord community.
Thank you for your contribution and interest in improving Vuetify.