-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
q-table - please add "sort direction" param to column definition #8527
Comments
I just wanted to mention that I know I can pass a custom sort function, but the asc/desc icons are problematic. When there is an asc icon (arrow pointing up) but the sort is desc, it looks broken. Visual cues are important, and consistency is perceived as quality in the financial services industry as everyone is very detail oriented. |
Will be available in Quasar v2.0.0-beta.13 & Quasar v1.15.11: new prop (column-sort-order) and new "columns" definition prop (sortOrder). Values: "ad" (ascending-descending) and "da" (descending-ascending). Default is "ad". PS: thank you for being a sponsor. |
Thank you, Razvan!
…On Sat, Apr 24, 2021 at 6:18 PM Razvan Stoenescu ***@***.***> wrote:
Will be available in Quasar v2.0.0-beta.13 & Quasar v1.15.11: new prop
(column-sort-order) and new "columns" definition prop (sortOrder).
Values: "ad" (ascending-descending) and "da" (descending-ascending).
Default is "ad".
PS: thank you for being a sponsor.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8527 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC7Y5YL3IIJA744TZ6ZB2WTTKNUXHANCNFSM4YA4WR6A>
.
|
The sorting works. Thanks very much for adding this! One very minor issue is that I would expect to see a down arrow when mousing over the column header of a column with a default descending sort. https://www.screencast.com/t/MpNdVZ76eHq When clicked, it does sort correctly and the arrow changes to point downward. Just confusing to see an asc hint and the sort be desc. |
I know, but implementing that requires way too much overhead which honestly we're better off... |
@Daemach or anyone having the same problem. You can easily fix this with CSS: just add a
|
@vojvodics Thanks for this suggestion. I appreciate it! |
Have you tried pasting it exactly as @vojvodics suggested? th.desc-first:not(.sorted) .q-table__sort-icon {
transform: rotate(180deg);
} |
@Daemach Sorry, initially I pasted the version for scss, so either copy the latest code, or just add |
Using your updated code worked. Thanks again for following up! |
@rstoenescu this is an elegant, low-overhead solution. Can this be added to the code base so I don't have to manually add it everywhere? |
@rstoenescu is this feature in yet? I'm on
Columns marked sortable:true
With this model:
It sorts it fine when the page loads but all columns are locked now, can't switch to sorting on another column |
I have the And my columns are still locked if I set my default like above. What am I missing? |
Still having this issue but the CSS above worked for me as a temporary fix. |
Here's a video describing the problem: https://www.screencast.com/t/GtHFyqLMA
It would be wonderful if I could add an attribute as below that would set the default sort direction at the column level, rather than just once for the initial load in the pagination object:
Numeric columns are nearly always more useful sorted desc initially, whereas alpha columns are better sorted asc. This is the case whether the data comes from an array of objects or from an ajax call.
And since I'm stuck on Q1 at the moment, backporting it there would be great. Although having it in Q2 might be enough for me to make the switch...
The text was updated successfully, but these errors were encountered: