How do you use fnSortListener?
How do you use fnSortListener?
Hi
I am wondering if fnSortListener is what I need but I don't understand how it works(from the example). This is my problem. I have a column that has dates like this
Aug 13 @ 4:04 PM
This date would be very hard to make a sorter for especially since no year is shown(it is not really useful to the user).
So what I want to do is have a hidden column with a date stamp something that datatables already knows how to sort by.
So when a user clicks on the column with these Aug 13 @ 4:04 PM dates in it. It actually sorts the hidden column.
Can fnSortListener do this? All my other columns should be fine and sort so they don't need hidden fields.
I am wondering if fnSortListener is what I need but I don't understand how it works(from the example). This is my problem. I have a column that has dates like this
Aug 13 @ 4:04 PM
This date would be very hard to make a sorter for especially since no year is shown(it is not really useful to the user).
So what I want to do is have a hidden column with a date stamp something that datatables already knows how to sort by.
So when a user clicks on the column with these Aug 13 @ 4:04 PM dates in it. It actually sorts the hidden column.
Can fnSortListener do this? All my other columns should be fine and sort so they don't need hidden fields.
This discussion has been closed.
Replies
iDataSort will tell DataTables to sort by a different column for the column that is the 'target'.
An alternative, if you didn't want to use a hidden column, would be to use the hidden title numeric sorting plug-in: http://datatables.net/plug-ins/sorting#hidden_title . This will take a number from a span tag's title attribute and sort on that.
Regards,
Allan