Hi,
thanks for your post, and sorry for the trouble.
Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!
Regards,
Tobias
Hi Tobias,
thank you very much.
This is the link of my website: http://www.timemanagement.sk/tablepress-test/
The funny thing is, that it sort of works now, but I had to switch the language from Slovak to English in the Settings part of TablePress. But it only works partialy, because user cant choose between sorting ASC and DESC…
Regards,
Andrej
Hi,
thanks for the link! From what I can see, the problem might be the spaces between the day, month, and year. The sorting algorithm can not recognize those.
Regards,
Tobias
Oh, it doesnt work anyway. I noticed that I manually sort the table. So it wasnt sorting at all. If you look there now, you can see that it’s not sorted and clickiing on the <thead> doesnt do anything. And yes I removed the spaces…
Is this code good for my case?
"aoColumnDefs": [ { "sType": "date-eu", "aTargets": [ 0 ] } ]
Hi,
yes, that code is totally correct.
Now I found the reason for this: Your theme has some JavaScript code built-in to make the table responsive (when you view it on a small screen). It does that by adding some extra HTML code to the beginning of each cell, which you can see e.g. by inspecting the table with the Google Chrome Developer Tools. This HTML code then breaks the sorting, as the DataTables JS library just can’t know what to do with it.
That JS code in the theme is in the section // Responsive tables in the file /wp-content/themes/SimplicityNew/js/gk.scripts.js. I suggest to temporarily remove that.
Regards,
Tobias