Forums › Forums › Search & Filter Pro › Elementor Pro : Results are not filtered (Ajax)
- This topic has 7 replies, 2 voices, and was last updated 5 years, 10 months ago by Trevor.
-
Anonymous(Private) January 10, 2019 at 4:22 pm #198614
Hi,
I have troubles to setup S&F on my website using Elementor Pro.
I have created a basic filter by category following your doc : https://searchandfilter.com/documentation/3rd-party/elementor/ and using Ajax.
I manage to display the filter by using shortcode and my posts grid but when I chose a category in the dropdown list, results are not filtered, even so they seems to be refreshed.
Could you please help me ? I followed the documentation except the part “Masonry & Ajax” because I don’t know how to add the js…
ThanksTrevor(Private) January 10, 2019 at 5:02 pm #198617To add the js.
Add a text block to the page above the post grid. The code you need to paste (copy it from the forum thread, and NOT from the email) into this text block is:
<script>(function ( $ ) { "use strict"; // detects when the ajax request has finished and the content has been updated // re-init the layout scripts from Elementor $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ elementorFrontend.hooks.doAction('frontend/element_ready/posts.classic', jQuery('.elementor-widget-posts')); }); }(jQuery));</script>
Anonymous(Private) January 10, 2019 at 9:46 pm #198627Thanks Trevor.
I have tried but it still doesn’t work.
I also see that when I choose an option in the dropdown list my posts grid is refreshed in AJAX : the number of displayed posts remain unfortunately the same, moreover the layout is broken : post format/height is changing…
Thanks for your help…
-
AuthorPosts