Skip to content
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

[Feature Request] VDataTable should have the option to display a default sort icon on sortable column headers #21069

Open
cojohnson1999 opened this issue Mar 5, 2025 · 0 comments
Labels
C: VDataTable T: enhancement Functionality that enhances existing features

Comments

@cojohnson1999
Copy link

Problem to solve

Currently, v-data-table has no way of rendering a placeholder sort icon in a column header to indicate to users that the column in a data table can be sorted. As it is right now, you can only see that a column is sortable by hovering over its header. If you want to add a default sort icon, you'd currently have to use the #headers slot and recreate the entire header of the table to accommodate the change... which seems like overkill.

Users of the website I'm building indicated that they weren't aware that headers could be sorted without a default icon, until they were instructed to click on a header to sort the table by that column. That would indicate to me that this is enough of a use case to warrant having the option to show show a default sort icon on a header if the sortable prop of the header is true.

Proposed solution

Include a default-sort-icon prop on v-data-table and v-data-table-server that renders a default sort icon when provided with a value. That prop should provide a default sort icon on sortable headers when included. Headers that are not sortable should not render a default icon. If the prop is not included on the table, no sort icon should be shown to maintain current data table functionality.

@KaelWD KaelWD added T: enhancement Functionality that enhances existing features C: VDataTable labels Mar 7, 2025
@github-actions github-actions bot removed the S: triage label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDataTable T: enhancement Functionality that enhances existing features
Projects
None yet
Development

No branches or pull requests

2 participants