Skip Navigation

[Resuelto] Trigger search filters from an external source.

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:
Trigger search filters from an external source.

Solution:
To trigger the search filter obviously you will require to add the custom JavaScript code that should trigger the change event of the country dropdown.

You can find the proposed solution in this case with the following reply:
=> https://toolset.com/forums/topic/trigger-search-filters-from-an-external-source/#post-2037713

Relevant Documentation:

This support ticket is created hace 3 años, 6 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Este tema contiene 3 respuestas, tiene 3 mensajes.

Última actualización por Stephen Vaughan hace 3 años, 6 meses.

Asistido por: Minesh.

Autor
Mensajes
#2037533
Screenshot 2021-04-30 at 09.37.17.png
Screenshot 2021-04-30 at 09.37.02.png
Screenshot 2021-04-30 at 09.36.43.png

Tell us what you are trying to do?

I have a map set up using the Interactive Geo Maps plugin. With this you can hover over each region on the map and it will trigger an action. As you can see in my screenshots I have the Action Content field set up to go a specific page, but, what if I could set a trigger to change the County filter in a view to narrow down the listings to just that county. Is there any toolset method to do this, before I go off to what I presume will be a javascript solution?

#2037701

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

To trigger the search filter obviously you will require to add the custom JavaScript code that should trigger the change event of the country dropdown.

Do you mean you want to prefilter the view result with specific country? If yes, again on document ready event you should add add a JS code to change the option of country dropdown.

#2037713

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Hi Stephen

You will need a JS solution, yes.

You'll react to the event triggered by clicking on the map, and then update the option for the county filter with JS.

If you are using the setting that the View results should update whenever a filter value changes then you need to be aware that this responds to the change event on the filter, but when you programmatically update the selected option the change event is not triggered, and you'll need to do that yourself.

Something like

jQuery("select[name='wpv-county']").val("clare").change();
#2037715

Thanks again Nigel. That gives me something to work with.