Forums Forums Search & Filter Pro Made a new Search and it doesn't works.

Viewing 10 posts - 11 through 20 (of 28 total)
  • Anonymous
    #32881
    This reply has been marked as private.
    Ross Moderator
    #32922

    Hi Idan

    Ok so to answer your questions:

    2) yes the code has been designed to work with labels – so styling labels based on checked state is built in. If you want to style the li element that the checkbox is contained in then you will need to write some custom javascript to add / remove classes based on whether the checkbox is ticked.

    Something like (untested, and will need some adaptation, this is just for the general idea):

    jQuery(document).on("change", ".searchandfilter .yourfieldclass li input[type='checkbox']", function()
    {
        if(jQuery(this).prop("checked")==true)
        {//then update the background colour
            jQuery(this).parent().css("background-color", "#f00");
        }
    
    });

    In the code above you will need to update .yourfieldclass with the name of the class on the field element.

    It will likely need some work to do what you want but I think its a decent indication of the direction to take.

    3) This again is some custom code that is out of the scope here really.

    You would need to detect a click on the LI, and then set any checkbox elements inside to “checked”

    jQuery(document).on("click", ".searchandfilter .yourfieldclass li", function(){
       //detect a click on an  LI element within a specific field.
       //then set the checked state to true
       jQuery(this).find("input[type='checkbox']").prop("checked", true);
    });

    You can use the code above as a basis for solving your tasks but its not officially supported within the plugin itself.

    Thanks

    Anonymous
    #32952
    This reply has been marked as private.
    Ross Moderator
    #32953

    Hi Idan

    As mentioned, the above were just examples of the correct approach – I didn’t test the code, merely wrote the logic (and hoped the exact syntax would be correct).

    I’m sure its not too far off, but these are things you will need to figure out for you own environment.

    If you need JS help there are plenty of resources online which I’m sure you could adapt – eg:
    http://stackoverflow.com/questions/10846127/change-parent-div-on-inputtype-checkboxchecked-with-css

    I’ll consider to add in some similar functionality in the future.

    Thanks

    Anonymous
    #33135
    This reply has been marked as private.
    Anonymous
    #33190
    This reply has been marked as private.
    Ross Moderator
    #33268

    Hey Idan

    I’m working on this issue right now

    I’ll send you another update once its complete.

    Thanks

    Ross Moderator
    #33443

    Just sent you a fix, let me know if it works for you!

    Thanks

    Anonymous
    #33485
    This reply has been marked as private.
    Ross Moderator
    #33491

    Hi Idan

    So the issue here is that your Javascript is not being loaded & applied to the new results that appear.

    To resolve this issue you can disable ajax (the easy, not so pleasant way).

    Or, better yet, re-initialise your JavaScript once the S&F results are loaded in (this requires some coding knowledge).

    Check the first question in the FAQs for an example of how to do detect when S&F has loaded new results: http://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/

    Thanks!

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