Sorting non-numeric columns
Sorting non-numeric columns
aaplmike
Posts: 6Questions: 2Answers: 0
Hey all. I have a column with progress bars as images which I'd like to be able to sort on.
How would I go about exposing a value that the sort algorithm could use to sort them correctly, without displaying that value in the interface?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
What do you mean by "sort them correctly"? Sort them according to what criteria?
I know programmatically what the value is, but am displaying only an image in that column. Is there a key/value pair datatables looks for that I can tack on to the img tag, for example. The goal is not to display any text in the columns.
One relatively simple solution would be to add a hidden column containing your images' "internal" values, and use that column to sort the images column.
https://datatables.net/forums/discussion/25782/how-to-sort-using-a-hidden-column-in-1-10-0
Thanks, Tangerine. Perfect.