Hi,
thanks for your post, and sorry for the trouble.
Unfortunately, I’ll have to disappoint you here. TablePress does not ship with a sorting algorithm for heights like that, and as far as I know, DataTables does also not offer one at the moment.
The reason why it works on the “Edit” screen is pretty much luck, in that the sorting library on the “Edit” screen interprets the strings differently and uses “natural” sorting.
So, in order to get these to sort correctly, you could develop a custom sorting algorithm using the DataTables API functions.
Another idea would be to tell DataTables to not actually use this data for the sorting, but that from an extra (but invisible to the user) column. That means, you could add a new column to the table, where you manually enter the height values in inches, as a plain number. Then, you could use a “Custom Command” on the table’s “Edit” screen like
"columnDefs": [ { "visible": false, "targets": [ 3 ] }, { "orderData": [ 3 ], "targets": [ 2 ] } ]
to tell DataTables to hide that new column, and to use the data from that hidden column for the sorting of the actual heights column.
(The numbers here would have to be adjusted: The “2” would refer to the actual height column (where 2 indicates third column, as counting in this code starts with 0). The “3” would refer to the hidden column (where 3 indicates fourth column).
Regards,
Tobias