Skip Navigation

[Resolved] Strange behaviour when “Update … when clicking on the search” is selected

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

Problem:

The issue here is that the user's custom js is not being re-activated after their parametric search. Also they were saying that their search bar is updated after an item is selected.

Solution:

If you're using a custom js on your search then you need to use the callback function to invoke that js again. To add the callback function go to the JS editor of your filter section and then click the Frontend Events button and this should bring up the callback functions.

All that is needed is to add the appropriate callback function then add your custom js within that function.

Secondly with the "Show only available options for each input" then this will update the filters once selected so that there will be no combination of filters that won't produce a result.

If the filters are updated after the search is made then it would be possible to submit a combination that would result in a "No Results Found". This essentially defeats the purpose of the "Show only available options for each input" which will always ensure that your view returns some results.

This support ticket is created 6 years, 2 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
- 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)

This topic contains 5 replies, has 2 voices.

Last updated by Shane 6 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1093724

Hello,

The option for "Update the View results only when clicking on the search button" is not working nicely.

1. Bug/ Missing feature: custom JS filters are not invoked after the custom search was updated, but the search is immidiatly updated when the user changes a selection...

2. " Show only available options for each input"

We also have " Show only available options for each input" enabled.

The problem is, that the search bar is updated as soon as the user selects something. We want it to be updated when the users clicks "search" as well.

Filter bar and results are one component from the users view. So they should also behave like one.
The current behaviour makes it quite difficult to use both components as one.

#1094029

Shane
Supporter

Languages: English (English )

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

Hi Adrian,

Thank you for contacting our support forum.

If you're using a custom js on your search then you need to use the callback function to invoke that js again. To add the callback function go to the JS editor of your filter section and then click the Frontend Events button and this should bring up the callback functions.

All that is needed is to add the appropriate callback function then add your custom js within that function.

Secondly with the "Show only available options for each input" then this will update the filters once selected so that there will be no combination of filters that won't produce a result.

If the filters are updated after the search is made then it would be possible to submit a combination that would result in a "No Results Found". This essentially defeats the purpose of the "Show only available options for each input" which will always ensure that your view returns some results.

Please let me know if this clears things up for you.

Thanks,
Shane

#1094588

Hello Shane,

Thank you for the clarification, which totally makes sense.

The problem with the filter is, that we wan't users to allow to selected multiple filters at once and then press the button.
Currently it is quite annoying that we have a (quite slow) loading whenever the user clicks something. Also it isn't obvious that the filter is automatically refreshed but for the results the user has to press the button.

-> so it would be nice to have an additional option for this is the future too (or much improved performance -> filter caching)

#1095090

Shane
Supporter

Languages: English (English )

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

Hi Adrian,

Yes I understand this concern, we are constantly working to improve our features and optimise them.

I see that you are already using a caching plugin.

Also could you try our documentation suggestion in the link below.
https://toolset.com/documentation/user-guides/front-page-filters/how-to-use-views-parametric-search-on-large-sites/

Thanks,
Shane

#1095654

Hello Shane,

Interesting, we are using WPML, so the cache is off.

Maybe in a newer version the cache should just use the current language as well when WPML is active. This would at least solve the WPML problem.

Thank you anyway. Great plugin with much potential.

#1096192

Shane
Supporter

Languages: English (English )

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

Hi Adrian,

Happy I was able to assist you with these issues.

If there are no further questions you can just mark this ticket as resolved so that other users will be able to see this thread when searching.

Thanks,
Shane