Skip Navigation

[Gelöst] Views filter loses values when results are updated via Ajax

This support ticket is created vor 6 Jahre, 11 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 Antworten, has 2 Stimmen.

Last updated by Luo Yang vor 6 Jahre, 11 Monate.

Assisted by: Luo Yang.

Author
Artikel
#522917

I've got a View that uses a custom search and parametric filter to display results, along with a Views Filter widget in the sidebar to filter the results via Ajax.

When I set values in the Views Filter, the page updates via Ajax but also reloads the controls in the widget - resetting them to a state with no values.

Can the selected values be persisted between reloads?

#522958

Dear Joff,

The AJAX feature of custom search form only work when you are outputting both the search form and the search result within the same Views shortcode [wpv-view], it will not work as expected when you put the search form in the widget.

In your case, you can both the search form and the search result within the same Views shortcode [wpv-view]:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-view

#523099

Hi,

I'm not sure I understand what you're suggesting by using the Views shortcode. I'm adding the View to the page already using the shortcode, but the form controls need to be in the sidebar (on the same page).

As the View also includes the form by default I've hidden it on the View output, so effectively there are two forms on the page already - the visible sidebar widget and hidden on the View.

#523299

If the form controls need to be in the sidebar, you will need to disable the AJAX feature of the Views search form, it won't be able to work as expected when you put the search form in sidebar widget, and the search result in the main content.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.