Sort value for column different from displayed value
Sort value for column different from displayed value

This may be a very common problem, but I did not find any relevant (and easy) solution so far:
I need to sort the rows of a table by a different value that the respective column shows.
Example:
* Value to be displayed: 11,85 m
* Value to be sorted by: 1185
If the sorting happens by the alphynumerical displayvalue, the sorting is wrong is it's interpreted as a string. So it should be sorted by the pure numeric integervalue in cm (which is available in my data).
In footable, there was an option to set an attribute "data-sort-value" which wouldl be used instead. Is there any similar (and simple, meaning no JS coding again) way to do this in DataTables?
This question has an accepted answers - jump to answer
Answers
Here's an example using a hidden column for sorting:
https://datatables.net/forums/discussion/25782/how-to-sort-using-a-hidden-column-in-1-10-0
Orthogonal data is used for this. You can use HTML5 attributes or the render function.
Kevin
Thanks for that link, it describes desired solution by providing a separate column as hidden and defines this hidden column as sorting column for another one to be displayed.
Thanks again!