Skip Navigation

[Resolved] Ajax search not work in views

This thread is resolved. Here is a description of the problem and solution.

Problem:
A custom search set to use ajax is not updating, nothing happens when changing filters.

Solution:
The View in question was split, with the search form inserted separately from the View results.

The View used a shortcode attribute to set a Query Filter value, but the attribute was only present on the Views shortcode that inserted the results, and was missing from the shortcode that inserted the search form.

This support ticket is created 5 years, 9 months 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 3 replies, has 2 voices.

Last updated by William Locatelli 5 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#920773

I used ajax search in this view and works fine: hidden link

Now i created a similar views but ajax search doesn't work and i don't know why.
Link to a page where the issue can be seen: hidden link

It looks like the search button or the select input does not trigger any events.

Thanks

#921145

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi there

I visited the two pages and can see how the first View appears to be working and the second not.

Looking at the network tab of the browser dev tools I can see that the second View is submitting and receiving a valid request—it is doing something—but the results themselves are not updating.

To understand why I should probably take a look.

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site, even though I don't intend to make any changes.

#921280

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I think the problem is that the View for Films uses a shortcode attribute to specify the age, and when inserting the View you have split the View form and the View results to insert them separately, but the shortcode attribute wpvfasciaeta was missing from the wpv-view shortcode that inserts the form.

I just added it, and it seems to me that the filter works okay now, if you could please confirm.

#921287

Thanks Nigel. Work like a charm!

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