-
Notifications
You must be signed in to change notification settings - Fork 357
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
Datatable custom sort or sort on hidden span #521
Milestone
Comments
In your sort function, you can do whatever logic you want for sort on a given field.
Notice those else statements checking the 'sortBy' field. the return statement following doing a localCompare can choose a different field to do the actual sort on. Here's the matching view.
|
Closing this since a solution was provided |
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi guys,
I think it's a feature request, but maybe this is already possible: Is there a possibility to sort on a hidden span element of the
<ng-template tdDataTableTemplate="column">
?I have a column displaying date data transformed by a pipe like:
row1: 6 years ago
row2: 3 months ago
row3: 3 hours ago
row4: 6 weeks ago
The sorting here doesn't do what it's supposed to do as you can imagine. If i could add a hidden span to the ng-template with the original date value and this is sortable, it would really help!
I hope you understand my question and you can point me in the right direction.
Thanks!!
Regards,
Martin
The text was updated successfully, but these errors were encountered: