Hi,
thanks for your post, and sorry for the trouble.
You are right, numbers with a comma as a thousand separator will not work out of the box, as the comma makes those numbers strings, and strings are sorted differently. To work around that, please install the TablePress Extension from http://tablepress.org/extensions/datatables-sorting-plugins/ and add this to the “Custom Commands” textfield on the “Edit” screen of the table:
"aoColumnDefs": [ { "sType": "formatted-num", "aTargets": [ 1, 3 ] } ]
Regards,
Tobias
Thread Starter
kancur
(@kancur)
Thanks for your response, I have already tried it. It’s not working for me :-/ But the currency column is working without problem. Only problem seems to be the 1,000,000 number. Sorry I’m a beginner in wordpress and so on
Thread Starter
kancur
(@kancur)
I reuploaded that plugin to be sure. No change.
Here is another example http://www.good3dprojector.com/test-page/
Password:123
This is the code I put in Custom commands:
"aoColumnDefs": [ { "sType": "formatted-num", "aTargets": [ 6 ] } ]
Still it seems that numbers with , as thousands separator are treated as if , is a decimal separator! I don’t get it.
Thank you very much for spending your time on this 🙂
Hi,
from what I can see, you are using a second piece of JavaScript for the sorting, besides the DataTables library that TablePress uses.
Namely, there’s a “jquery.tablesorter.js” script being loaded. My assumption is that that is interfering right now, so please turn that off again so that we can further investigate this.
Regards,
Tobias
Thread Starter
kancur
(@kancur)
Oh yeah!! 🙂 Thank you, sorry I’m a total newbie in this.
Thank you very much! Your plugin is awesome!
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
Thread Starter
kancur
(@kancur)
🙂 I have one more question, can you suggest me a solution to sorting column: Resolution
It could be based on sorting just the first number before x character.
or maybe x could work as a multiplication …
Thread Starter
kancur
(@kancur)
(Somehow the link is not visible in previous post)
Link:
http://www.good3dprojector.com/
Hi,
sorry, unfortunately, I don’t have a solution to that. That’s a similar problem as sorting for those ratios with the :. You would need to develop a custom sorting algorithm in JavaScript that extracts that number from the cell and uses it for the sorting, similar to the other algorithms in the Sorting Plugins Extension.
Regards,
Tobias
Thread Starter
kancur
(@kancur)
Anyway, thank you very much 🙂
Hi,
sure, no problem! Sorry that I couldn’t help with that.
Regards,
Tobias