Skip Navigation

[Résolu] JS event listener for change in a parametric search

This support ticket is created Il y a 4 années et 4 mois. 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 – 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)

Marqué : 

This topic contains 3 réponses, has 2 voix.

Last updated by Tim Elliott Il y a 4 années et 4 mois.

Assisted by: Shane.

Auteur
Publications
#1379023

Tell us what you are trying to do?
I have a masonry grid in a view - the size of the elements are updated using javascript to give the masonry effect. I have event listeners to run this code onload and when the screen is resized.

window.addEventListener ?
window.addEventListener("load",resizeAllGridItems,false) :
window.attachEvent && window.attachEvent("onload",resizeAllGridItems);

window.addEventListener("resize", resizeAllGridItems);

However they don't resize when the page is refreshed by ajax for a change in a search parameter. Is there a way add a listener for the update to parametric search?

On a connected note, the image I have in the loop doesn't display after the ajax refresh either.

Is there any documentation that you are following? No

Is there a similar example that we can see? Not that I know of

What is the link to your site? hidden link but you will need to be logged in to view.

#1379029

Actually you can ignore the second part "On a connected note, the image I have in the loop doesn't display after the ajax refresh either". The image doesn't display if I use a custom size, but if I use a standard size it does.

#1379093

Shane
Supporter

Languages: Anglais (English )

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

Hi Tim,

Thank you for contacting our support forum.

Actually given that its an ajax event done with views you will need to add the callback function for the even.

Go to your Filter Editor in your view and then click on the JS tab. From there you should see a button called Frontend Event..

Click this and from there you can add the appropriate callback function that is required for your view.

Thanks,
Shane

#1379269

Thanks Shane, that's done it.

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