I actually just added another column on a test table and it looks like it’s actually cycling through ascending, descending, and then original order as displayed. We just happen to have it in the right order originally so that’s what is showing up. That can be seen by sorting the two different ranking columns here: https://collegestunt.org/testrankings/
I have TablePress Pro.
-
This reply was modified 3 weeks, 5 days ago by
jimlord.
Hi Jim!
Thanks for your post and sorry for the trouble!
Your observation is correct: The sorting is “ascending” -> “descending” -> “original order” and so on.
Now, the cause for the wrong order here is that some cells actually contain text and not just numbers, namely “NR” or things like “… (tie)”. This switches the sorting algorithm to text string sorting, where “10” is then sorted between “1” and “2”.
The question now is how you would like to treat this. My personal feeling would be to actually simply turn off sorting for that Rank column (and also the second column, with the team logo). For that, you could add this to the “Custom Commands” text field on the table’s “Edit” screen:
columnDefs: [
{ orderable: false, targets: [ 0, 1 ] },
],
Best wishes,
Tobias
I started to realize that when testing some other stuff. I think my best option maybe to keep the numbers in one column and add any text in a second column right next to it and try to size those columns to be minimum width.
One problem I found with this approach is that if I don’t have anything in the rank column, then that blank cell gets sorted first instead of last. I’ll play around with these options and if I find a good solution I’ll repost here in case anybody else can use a solution. Thanks so much for always being so responsive!!! Best plug-in and developer on the planet.
Hi Jim,
We could actually also use a custom sorting that will always keep “NR” entries at the bottom. However, as this concerns the TablePress premium support, I would please need to get you in touch via email, to the address that you can find on the “About” screen of TablePress on your site.
Best wishes,
Tobias