New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datatable - Default sorting (or no sort at all) / manual sorting #442
Comments
I can't find this feature anymore. Merged code is not exists in current code. |
Take a look at example 7 in the docs to see how you could do manual sorting and/or default sorting. You need to use the |
In case it helps anyone else looking for default sorting in a data table: Create a data-table. Use hide-actions to not show the pagination tools at the bottom and bind pagination.sync to an object in your dataset.
In your data, create a pagination key with a object. To display all rows, use the rowsPerPage value of -1.
This will sort by column2 ascending and display all items |
It's possible sort by multiple columns? |
The issue board is strictly for bugs. Please direct all questions to the official Discord server. |
For anyone wondering.. sorting by multiple columns is not supported until #3833 merges. |
@mchugh19 Thanks! My question: Is it possible to do that but with pagination? (Not hiding actions below the datatable) |
@jpldev It works fine for me without hide-actions. |
Thanks, it works! @JThinkable |
fwiw, the docs have it too: https://vuetifyjs.com/en/components/data-tables#example-sort |
It would be nice to be able to sort / keep items in order when loading the data.
Feature
I need to display the datatable sorted DESC using a field (which is the last one in the header list). I can't find a way to do it (maybe I'm wrong). It's an issue especially as the API returns everything in order and Vuetify sorts everything using the first column.
I think it's not a edge case for my project, sorting is really important and at least it would be great to be able to keep the result sorted even if we want to have sortable columns.
Implementation I'm thinking about
Having a default-sort prop in the datatable component using the
name
property of the header and a direction.or
I could probably implement it if you think it's good.
The text was updated successfully, but these errors were encountered: