Add ability to define sorting function for column.
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
}
}
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
I have column with Date and column with computed value. And I don't know how to sort it with customSort both.
Available in 2.0 alpha.
is there any workaround for this feature for release "vuetify": "^1.5.1"?
@ManishaDhingraNiit you can try this https://stackoverflow.com/questions/52678905/how-to-use-vutifys-custom-sort
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?
Most helpful comment
There's a
customSortprop, but it's global (one fn for all headers). It could for example accept the object indexed byheader.value, ifcustomSort[...]is not defined then it could use the default sorting method, otherwise use the provided one