Skip to content

sort on multiple params #76

Answered by vincjo
vorian77 asked this question in Q&A
Nov 7, 2023 · 4 comments · 3 replies
Discussion options

You must be logged in to vote

Thx
Yes i meant the visual indicator 👍

I guess you expect last names to be sorted alphabetically. But if 2 people have the same, then the first names are sorted too, right?

Literally “sorting last names and first names”.

If you do it manually by clicking on the table, you must 1) click on nameFirst column, then 2) on nameLast to get this result.
Same way for applySort.

handler.sortAsc('nameFirst')
handler.sortAsc('nameLast')

// or
handler.applySort({ orderBy: 'nameFirst', direction: 'asc' })
handler.applySort({ orderBy: 'nameLast', direction: 'asc' })

// will sort items by nameLast and nameFirst

If i understood correctly you just need to reverse items in your sortItems array

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@vorian77
Comment options

@vincjo
Comment options

Answer selected by vorian77
Comment options

You must be logged in to vote
1 reply
@vorian77
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants