I have a view that displays results from a CPT called Referrals. The Referrals have a Post Reference field with CPT Attorneys. In a view I am displaying the referrals with a table with sortable columns enabled. I show the Attorney Name via the Post Reference @attorney.parent in the Types shortcode. The Sorting for that column does not work. When I click on the Column to sort it, the views' results go empty. Any direction would be appreciated.
Sorry Waqar I stepped away from computer. Let me know if you can assist now.
Hi Mukesh,
Thank you for waiting and I'd be happy to assist.
To better guide you around the missing link, I'll need access to the website's admin area, to see how the view and the enclosed table are set up.
Can you please share temporary admin login details and the link to the page with the view, in reply to this message?
(your next reply will be private)
Note: Please make a backup copy of the website, before sharing the access details.
regards,
Waqar
Hi Mukesh,
Thank you for waiting and I apologize for the delay.
I checked the two views and here are my findings:
1. The "Referrals Office Follow Up" view ( hidden link ), is using the following code for the "Law Office" column:
<th>[wpv-heading name="types-field-law-office"]Law Office[/wpv-heading]</th>
But the view is for the post type "Referrals", and the custom field "Law Office" is attached with the post type "Attorney" and not "Referrals".
2. The other view "Bucket 2: Referrals with Office Follow Up" ( hidden link ) is also for the post type "Referrals" and includes the following code for the Attorney column:
<th>[wpv-heading name="types-field-attorney"]Attorney[/wpv-heading]</th>
The "Attorney" field is attached to the post type "Referrals" but it is a post reference type field, which stores IDs of posts and not the titles.
This means that the sorting will work, but the results will be ordered by numeric IDs and not by the title text.
Note: The ID-based numeric sorting for post reference fields, works on my test website, but not on yours. I'll recommend updating all toolset plugins to their latest versions and then check this sorting again.
I understand that even when the ID-based sorting will work, it won't be useful for your case. To make this work, I'll recommend dropping the built-in query based table column sorting and add it through front-end script.
You'll find more details on this in my reply at:
https://toolset.com/forums/topic/sorting-nested-tables/page/2/#post-1175110
regards,
Waqar
Hi Waqar,
Thanks, let me look into sorting through front-end script. I am still waiting for the other ticket that you have for me, which is updating Toolset Forms. I don't want to update all the plugins without that fix. Do you know the status of the other ticket?
Thanks
Mukesh
Hi Mukesh,
I'm afraid, I don't have an update to share at the moment, related to the other report.
( ref: https://toolset.com/forums/topic/latest-toolset-forms-2-1-2-is-causing-error-_tt-param-in-url/ )
But, I'll keep you updated with the progress on it, through that ticket.
I noticed that all Toolset plugins are updated now on the website. Even if you need to keep the older version of Toolset Forms, you can keep all other Toolset plugins up-to-date.
You're welcome to open a new ticket for each new question or concern.
regards and have a great weekend,
Waqar
Hi Waqar,
On the link you referred me to for the front-end sorting functionality, your post there has two links but both are hidden, can you send me those links? Here is the reply with those hidden links: https://toolset.com/forums/topic/sorting-nested-tables/page/2/?bbp_reply_to=1175110&_wpnonce=7d38d897a6#new-post
Thannks
Mukesh
Hi Mukesh,
Sorry, I thought those links would be available to you, while logged-in to the forum.
I'm sharing them in this thread, directly:
hidden link
hidden link
regards,
Waqar
My issue is resolved now. Thank you!