Forums Forums Search & Filter Pro Show results on same page + filters not working

Viewing 9 posts - 31 through 39 (of 39 total)
  • Trevor
    #185866

    I don’t, but try searching on Stackexchange.

    Anonymous
    #185876

    I think I started something here:

    First I unchecked the Auto submit form option to use the enter keypress to trigger the next action.
    Then I put an onkeypress function on the header search field to make it copy its value to sidebar’s search field (which will be hidden) on enter keypress.

    The first thing I needed is here: the same value on both inputs. But some other things are not exactly on place. I just wannna know which triggers S&F use so I can dig into them to make things work.

    Whenever I submit a search, S&F destroys and restores the search field input. Once I’m adding the onkeypress function through a js, the restored input overrides the setAttribute declaration. Is there a safer/definitive way to attach this onkeypress to the field?

    The other thing is: how S&F triggers the filters after a search? I think if I could figure this out, maybe I can head into a solution.

    Cheers

    Trevor
    #185884

    I think S&F looks for the change event to trigger the auto count.

    Anonymous
    #185888

    Which change event?

    Trevor
    #185890

    On each of the fields (inputs and selects). When one of these changes, our filter is monitoring this and sees the change, and triggers the auto count (if set to ON). You can copy from one form to the other, but often that won’t actually trigger the input to say ‘Hey, I have changed,’ so you have to do that (trigger the change event of the input copied to) after you copy the value over.

    Anonymous
    #185904

    Is there a debug mode? It would be great to access these events happening.

    Trevor
    #185906

    Other than WP-DEBUG that can be set in the wp-config.php (and an associated setting as to where to output, a file and/or the screen), no.

    I don’t know if Chrome has the tools you need. You can always add console.log(“message”) or whatever to your code and see the output in the browser console.

    There is also an event sf:ajaxformfinish (and also sf:ajaxformstart) which trigger when the Auto Count happens on the form. You can use these like this:

    <script>(function ( $ ) {
    “use strict”;
    $(document).on(“sf:ajaxformfinish”, “.searchandfilter”, function(){
    console.log(“ajax form auto count update complete”);

    // any other js here

    });
    }(jQuery));</script

    Anonymous
    #185908

    Okay, I’ll try something by the weekend. Thank you for the attention! 🙂

    Anonymous
    #186393

    Hey Trevor, just checking in.

    I’ve managed a workaround with the search form showing results on a new page and filters updating them.

    Thank you for your help!

Viewing 9 posts - 31 through 39 (of 39 total)