-
Am I correct to use applySort to apply multiple search params? Given the following:
And code:
The data table only sorts on the 'firstName' column. I'm trying to get it to sort "lastName" then "firstName". |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Your code is correct I think the columns are sorted correctly in the order given in |
Beta Was this translation helpful? Give feedback.
-
Hi @vincjo, thank you for your response and for building and maintaining this great tool! I think I'm still missing something. Is the "sorted column" state the visual indicator? That visual indicator is specifying Here is the actual code and console log of Can I somehow use .getSort() to determine exactly the current sort being applied to the table?
|
Beta Was this translation helpful? Give feedback.
-
Thx 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 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 |
Beta Was this translation helpful? Give feedback.
-
.getSort only returns the last sorted column. |
Beta Was this translation helpful? Give feedback.
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) onnameLast
to get this result.Same way for applySort.
If i understood correctly you just need to reverse items in your
sortItems
array