Forums Forums Search & Filter Pro Results don't show with AJAX, but do without AJAX

Viewing 10 posts - 11 through 20 (of 31 total)
  • Anonymous
    #73522

    Just wanted to follow up here. Did you find any issues with the code I’m using? Thanks for your help so far!

    Trevor
    #73568

    Sorry for not replying earlier. You would have needed to only use this bit of code:

    $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
      console.log("ajax complete");
      //so load your lightbox or JS scripts here again
    });

    And then wrap it as shown in this snippet:

    (function ( $ ) {
      "use strict";
      $(document).on("sf:init", ".searchandfilter", function(){
        console.log("S&F JS initialised");
      });
    }(jQuery));

    So your base combined snippet becomes this:

    (function ( $ ) {
      "use strict";
      $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
        console.log("ajax complete");
        //so load your lightbox or JS scripts here again
      });
    }(jQuery));

    And then you need to replace the one commented line (//so load your lightbox or JS scripts here again) with the actual function that re-initializes whichever script your grid uses. If you are able to share a sample URL from your site with the grid on, I can take a look at the code to see what that function might need to be.

    Anonymous
    #73681
    This reply has been marked as private.
    Trevor
    #73794

    Hi Rolla

    Your site home page, where the search form is, is more complicated than you had said. It appears to have 5 loops; one each for Architecture, Iconography, Music, Minor Arts, and Theory. As such, the Ajax method is not likely to work. It would need to go to a page with a single category loop on it.

    You may need to re-think how the search would work.

    Trevor
    #73796

    BTW. Great looking site. Nice design.

    Anonymous
    #73834

    Thanks very much for the compliment. I understand what you are saying about the multiple loops. However, I also tried it on a basic page with only one loop though and still couldn’t get it to work. Were you able to identify the lightbox/JavaScript code that I would need to place in that commented line so I can at least finish the workaround to get it working on a basic page?

    Trevor
    #73836

    Do you have a page with a single loop on I can work from?

    Anonymous
    #73838
    Anonymous
    #73840

    If it makes a difference in your troubleshooting, on that page (and the homepage) I am using the Display Posts plugin and shortcode to initiate the various loops within the pages.

    Here is a page where I’m running just the basic WordPress loop code within my template instead of using the Display Posts shortcode and it’s still not working:
    http://oaj.flywheelsites.com/sample-loop/

    Trevor
    #73842

    On that page’s (http://oaj.flywheelsites.com/sort-filter/) search form, can you change the results container to .display-posts-listing

    I can see no sign of any scripts working on the loop.

Viewing 10 posts - 11 through 20 (of 31 total)