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] Data table: custom sorting for column #3829

Closed
0vvland opened this issue Apr 11, 2018 · 6 comments
Closed

[Feature Request] Data table: custom sorting for column #3829

0vvland opened this issue Apr 11, 2018 · 6 comments
Assignees
Labels
T: enhancement Functionality that enhances existing features

Comments

@0vvland
Copy link

0vvland commented Apr 11, 2018

Problem to solve

Add ability to define sorting function for column.

Proposed solution

headers: {
  text: string;
  value: string;
  align: 'left' | 'center' | 'right';
  sortable: boolean;
  class: string[] | string;
  width: string;
  sort: (a,b) => {
   //replace with custom algoritm
    if(a>b) return 1
    if(a>b) return -1
    return 0
  }
}
@nekosaur nekosaur added the pending review The issue is still pending disposition label Apr 11, 2018
@jacekkarczmarczyk
Copy link
Member

There's a customSort prop, but it's global (one fn for all headers). It could for example accept the object indexed by header.value, if customSort[...] is not defined then it could use the default sorting method, otherwise use the provided one

@0vvland
Copy link
Author

0vvland commented Apr 11, 2018

I have column with Date and column with computed value. And I don't know how to sort it with customSort both.

@nekosaur nekosaur mentioned this issue Oct 6, 2018
9 tasks
@nekosaur nekosaur added T: enhancement Functionality that enhances existing features and removed pending review The issue is still pending disposition labels Oct 22, 2018
@nekosaur nekosaur mentioned this issue Nov 26, 2018
9 tasks
@nekosaur nekosaur self-assigned this Jan 24, 2019
@blalan05
Copy link
Member

blalan05 commented Apr 3, 2019

Available in 2.0 alpha.

@ManishaDhingraNiit
Copy link

is there any workaround for this feature for release "vuetify": "^1.5.1"?

@subashdbc
Copy link

@ManishaDhingraNiit
Copy link

Thanks for reply.
I have implemented custom sorting in my application. It is working fine with the property in data table. But when I use template for header as I am using select-all checkbox, so I need to iterate over the header array.
So by using template for header custom sorting is not working. Even sorting is not working on any column without pagination.
Any suggestion?

@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: enhancement Functionality that enhances existing features
Projects
None yet
Development

No branches or pull requests

6 participants