Sorting by column based on span value
Sorting by column based on span value
DataTables Rocks!
I'm stumped. I'm looking to sort my table based on data that isn't displayed or is formatted in a manner that isn't easily sortable as it's displayed. My initial thought is to dedicate a hidden column to hold this information and I could organize the data in span tags with a class that will elude to the data type. I see in the API docs the fnSort function will sort based on a column, but is it possible to sort the first column based on the contents of a span with the class of "entry_date"?
I understand I could create individual columns for each sortable data set, but I would like to reduce the amount of unneeded markup.
Thanks in advance.
I'm stumped. I'm looking to sort my table based on data that isn't displayed or is formatted in a manner that isn't easily sortable as it's displayed. My initial thought is to dedicate a hidden column to hold this information and I could organize the data in span tags with a class that will elude to the data type. I see in the API docs the fnSort function will sort based on a column, but is it possible to sort the first column based on the contents of a span with the class of "entry_date"?
I understand I could create individual columns for each sortable data set, but I would like to reduce the amount of unneeded markup.
Thanks in advance.
This discussion has been closed.
Replies
Allan
[code]
3
3
4
[/code]
I'm looking to sort based on the value of all span's with the class "rating_overall"...or sort based on the class "rating_technical". I'm not sure if this is an acceptable method or if it would be easier to create individual columns for each and pass the column number.
Regards,
Allan