JohnTendik / jtrt-tables

A Wordpress plugin to help users create responsive tables without having to read or write code.
GNU General Public License v2.0
22 stars 6 forks source link

Sorting numbers #49

Closed WEbMHighJack closed 6 years ago

WEbMHighJack commented 7 years ago

Hi.

Love the plugin but discovered that when sorting numbers it doesn't do it correctly for me: [https://highjack.se/wordpress/?page_id=1719]

F.i. in the column "Ändr.%" I would like -100 to come first and increasing downwards as first visible when opening the page, but it will rearrange (if sorting differently than it started with and then trying to sort it back) into -1 then -10 then - 100 then -12 and so on... After -19 it will place -2 then -21.

Either I have done something wrong, or there's a bug somewhere in the plugin?

JohnTendik commented 7 years ago

Hey,

For the number sorting to work properly you need to set the column data type to the correct format. The way to do that is easy there is a button on the editor that looks like a table cut in two.

Basically refer to this issue: https://github.com/JohnTendik/jtrt-tables/issues/44#issuecomment-302005051

Make sure instead of setting your column type to HTML you set it to number so it works properly.

Hope this help, thanks for using my plugin glad you found it useful :)

Thanks John

WEbMHighJack commented 7 years ago

Hi again. So I changed the columns to numeric format (thanks!) but it’s not working on the negative numbers, it simply removes them from the table/list completely. Any way to fix this?

Thanks, Anneli

JohnTendik commented 7 years ago

Hey sorry for the late reply, Im on vacation at the moment so I wasn't able to respond, my phone died.

As for the negative numbers issue, I looked at footables issues and I found this:

https://github.com/fooplugins/FooTable/issues/621

You are correct, the version of footables my plugin uses isn't the latest branch, therefore as the author of the plugin stated the regex is stripping out the - part of the number.

Unfortunately I wont be able to do any fixes or updates until I get back from my vacation on June 11, I don't have access to a pc other than my phone. You may try the quick fix which the footables plugin author has mentioned if youre comfortable working with code. If not, I'm sorry to say you will have to wait until I get back :(

Hope this helps, thank you for bringing this to my attention, I will add it to my fix list (which is getting bigger by the day haha)

Thank John

WEbMHighJack commented 7 years ago

I am more than grateful that replies are coming so quickly. Even when you're on vacation. Fantastic!

I might try the quick fix or maybe just "colorcode" the cells until you get a chance to fix it. No hurry, rest, relax and enjoy your vacation!

Thanks, Anneli