Home › Toolset Professional Support › [Resolved] Reset button does not hide the filter
Problem:
Reset button does not hide the filter
Solution:
You need to use view's front-end filter hook "js_event_wpv_parametric_search_form_updated" with some custom Javascript in order to fix this issue.
You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/reset-button-does-not-hide-the-filter/#post-921210
Relevant Documentation:
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 |
---|---|---|---|---|---|---|
- | 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)
Tagged: Views, Views plugin
This topic contains 5 replies, has 2 voices.
Last updated by RafaelL7560 6 years, 4 months ago.
Assisted by: Minesh.
Hello,
I'm having trouble hiding the filter. In this example hidden link, clicking on the reset button "Zurücksetzen" hides the other filters ( button "Weitere Filter"). The code to it is:
jQuery(document).ready(function($) { $(".js-wpv-reset-trigger").click(function(e) { $("div#moreFilter").hide(); }); });
Unfortunately, this example hidden link does not work with the same code. If I click on the reset button "Zurücksetzen" here, the other filters are unfolded instead of hiding them. It's the same code:
jQuery(document).ready(function($) { $(".js-wpv-reset-trigger").click(function(e) { $("div#moreFilterGM").hide(); }); });
Do you have an idea ahead it could be?
Hello. Thank you for contacting the Toolset support.
Well - I do not see the "Reset" button with any of the tabs. Do I misunderstand your issue here?
Could you please share few screenshot and point out what is the issue or step by step information so first I understand the issue and guide you in right direction.
If you click on the button "Weitere Filter" (Pic1) further filter options will appear, which are displayed below the location and radios. Now I want to use the reset button "Zurücksetzen" (Pic2) to hide the displayed filters again. So that only the location and radius are displayed again (Pic3).
This example works very well: hidden link
However, the example with Google Maps hidden link does not work, although it is the same code.
Ok - this looks like some JS issue. could you please share access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
Well - I've added following code to your view's filter section's JS box:
jQuery( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) { /** * data.view_unique_id (string) The View unique ID hash * data.view_changed_form (object) The jQuery object for the View form after being updated * data.view_changed_form_additional_forms_only (object) The jQuery object containing additional forms from other instances of the same View inserted using the [wpv-form-view] shortcode * data.view_changed_form_additional_forms_full (object) The jQuery object containing additional forms from other instances of the same View inserted using the [wpv-view] shortcode */ if( $('#moreFilterGM').css('display') == 'block'){ jQuery("div#moreFilterGM").hide(); e.preventDefault(); } });
I can see its working fine. I have made few other amendments as well , like - commented following line:
// btn.setText ("New button text");
And document.ready section:
jQuery(document).ready(function($){ jQuery("div#moreFilterGM").hide(); });
I see its working fine. could you please confirm.
Hello,
thank you, it works very well. Thank you for your help. 🙂 Great work 🙂