sort by date field.. want blanks to be last (latest)
sort by date field.. want blanks to be last (latest)
seamanjeff
Posts: 8Questions: 1Answers: 0
Is there any easy way to achieve this?
I saw some old posts on this but they were never really answered.
Here's a live demo: http://live.datatables.net/mawequma/2/
I'd like the row with the blank date to be at the bottom.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
bumping to let you know I added a datatables live demo
You can tell datatables that a empty date should be forced to the end of the table by returning JavaScript's max supported date only for sorting (and an empty string for display and internal data cache):
(Untested. I'm on mobile so I can't format the code properly either.)
That did the trick: http://live.datatables.net/daluvivo/1/ Thanks, Neil. I will re-read the part of the manual on "orthogonal data" and I'm sure more will sink in now.
No problem :-)
Nice trick - like it!
Allan