Hi,
thanks for your post, and sorry for the trouble.
The reason for this is that the content in the “Erfaring” column is not numeric, but strings (because of the the “år” after each value. And as strings are sorted differently than numbers, you get this result.
To fix this, you’ll either have to remove all ” år” from that column, or (as you have already installed the DataTables Sorting Plugins Extension), add this to the “Custom Commands” textfield on the “Edit” screen of the table:
"aoColumnDefs": [ { "sType": "formatted-num", "aTargets": [ 3 ] } ]
(The 3 in the code indicates that this shall apply to the fourth column, as counting starts with 0.)
To later also fix the sorting for the “Kontrakt” column, change that code to
"aoColumnDefs": [ { "sType": "formatted-num", "aTargets": [ 3, 7 ] } ]
Regards,
Tobias
Hello Tobias,
Thank you very much. It solved the “erfaring” part. I tried to include the 7th column, and inserted a few raw contract numbers just to test it out, but nothing happened.
Is it because the dollar sign is the first symbol?
Thank you!
Hi,
sure, no problem! You are very welcome!
For the “Kontrakt” column: You’ll need to add more values, otherwise you can’t see if the sorting works.
Regards,
Tobias
Oh okay, so I need to basically fill that entire column out for it to be sortable?
Hi,
yes, that might be necessary for the external sorting script to work.
Regards,
Tobias
Okay, thank you very much Tobias!
Have a good one.
Hi,
sure, no problem! You are very welcome!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!