-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
[Bug Report] v-data-table custom-key-sort uses key not value #18840
[Bug Report] v-data-table custom-key-sort uses key not value #18840
Comments
That seems like a bug not a documentation problem.
Yeah key has to be a valid object key, it doesn't accept a function. Key is used as an identifier in sortBy, groupBy, and slots. |
Thank you for lighting me. So should it work like this ?
Currently, it's working more like :
|
Problem to solve
Roles of key and value in headers are not explicits.
Regarding the doc, it looks like :
But it's not working this way.
Value can be used to process the string displayed, but is not sent to nor filtering nor sorting.
So, how can we sort processed data ?
As a side problem, how can we sort well sloted cells which are filled from many item properties ?
Example built from the doc : https://vuetifyjs.com/en/components/data-tables/basics/#keys-and-values
The issue is that the column, fullname, is not sorting well. Last colum is for testing processed data in the key : fail.
See playground
: https://t.ly/STk2u
We could think that "key" is here for referencing and value for sorting but it's not the case, see this example https://t.ly/eyMNr, only keys are used to sort, making some problems with processed data because it prevents from using them with sorting
It could be in another way, answering this question, how to make this doc example sorting correctly the last column https://vuetifyjs.com/en/components/data-tables/data-and-display/#basic-sorting
Processed value works for displaying, but as custom-key-sort only use the key provided value, it can't work for processed data. I think there is a shadow in the process but I can just be misunderstanding it
As a conclusion, it could be an example to integrate to the doc, showing how to make this table sorting well
Proposed solution
Would like to know how it should work with these cases to be able to detail the doc :
The text was updated successfully, but these errors were encountered: