Skip Navigation

[Resolved] ajax reloads page

This support ticket is created 2 years, 10 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 2 replies, has 2 voices.

Last updated by dimitriH 2 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#2433675

I am trying to: set a filter toggle so the filter can be used on mobile as well. I've got the script from here https://toolset.com/forums/topic/views-filter-toggle-visibleinvisible-on-mobile-devices/ but if I select something in the filter it reloads the page and I can't use the toggle anymore.

Link to a page where the issue can be seen: hidden link

#2433703

Shane
Supporter

Languages: English (English )

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

Hi Dimitri,

Thank you for getting in touch.

The issue here is that you will need to use the callback function for your view to reload the function after the view performs its AJAX search function.

Add your function inside this callback function as well.

jQuery( document ).on( 'js_event_wpv_parametric_search_triggered', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.form (object) The jQuery object for the View form
	* data.update_form (bool) Whether the custom search form will be updated
	* data.update_results (bool) Whether the custom search results will be updated
	*/
	
});

This will allow your code to run again once the search has been triggered.

Thanks,
Shane

#2434101

My issue is resolved now. Thank you!