Skip Navigation

[Resolved] Sort by numeric not working for table column header links

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by tisonK 5 years ago.

Assisted by: Shane.

Author
Posts
#1444505

I am trying to:
Sort table by numeric by clicking on a table column header.
Currently I'm able to click my sort dropdown for "Property Size" field and "Descending" and that sorts correctly (highest numbers on top (the highest being 2300000). But if I click the Property Size table column header, it sorts as a string (eg highest being "9996" and "99875" is shown below that, etc).

Link to a page where the issue can be seen:
hidden link

I expected to see:
(see above)

Instead, I got:
(above)

Sorting by "Property Size, Desc" in dropdown (correct result):
hidden link

Sorting by "Property Size (desc)" in table column header:
hidden link

Just a note that when it works correctly (when you click the sort dropdown), the url is:
hidden link

And when you click the table header you get this:
hidden link

Is there any way to fix this?

Thank you for all your help!
T

#1444603

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tison,

Thank you for getting in touch.

Is the Property Size field a number field or is it a text field ?

I tried viewing the page but it seems I need to sign into a microsoft account.

Thanks,
Shane

#1444649

Shane,
Thanks for the quick response.

The property size field is a custom field (just a regular wordpress custom field). When you say is it a number field are you asking if the contents are numbers? If so, then yes it is a square footage number basically.

When I setup the sort dropdown, I selected "Numeric" as well which worked (remember in my previous note on how the dropdown works but clicking the table column headers doesn't). Anyway does that answer your question?

I just created a user, you can login here:

#1446709

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tison,

Thank you for the credentials.

However they dont seem to have admin priviledges. Could you checked on them and let me know or update them to admin ?

Also did you disable the table header sorting because i'm not seeing the table header sorting. The problem could be that the table header is sorting the field as a string and in a case like this, it can sort incorrectly.

Thanks,
Shane

#1456361

My issue is resolved now. Thank you!