Support » Plugin: Collapse-O-Matic » Have collapse stay open when ajax option selected

  • Resolved LauraHartwigDesign

    (@laurahartwigdesign)


    First, thank you for this great plugin! I am using it with the Toolset Types plugin and it is working great. However, I would like to do one thing that I can’t figure out. I have set the sectors here: http://biocitygroup.staging.wpengine.com/companies to automatically collapse after the results of the filter have been rendered with ajax, but need the sector that has a filter selected to stay open so visitor can see which filter they have selected. So, for example, if someone opens the Biology sector and selects Bio-imaging, once the results are rendered, I need the Biology sector to stay open while the others close. Is there a way to do this by adding some js? I added the collapse_init(); to have them close, but want the one selected to stay open. Thanks for your help!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author twinpictures

    (@twinpictures)

    It seems that a little bit of jQuery would need to be added once a selection is made to keep it’s parent item expanded. Another thing to consider is what should happen if a selection is made in multiple sections?

    We have something like this built in to the pro version Collapse-Pro-Matic using an expand on attribute, however it might need to be modified slightly for your purpose. Our pro plugins come with a very high level of personal support that would cover integrating a simple solution like this.

    Plugin Author twinpictures

    (@twinpictures)

    Hello. Just checking in. It seems you have resolved this issue by not using the highlander grouping, correct? Can we mark this issue as resolved, or would you still like assistance on this?

    Thread Starter LauraHartwigDesign

    (@laurahartwigdesign)

    So sorry – I thought I had replied to this. I’m not sure what the “highlander grouping” is, but I was able to do it with some jQuery. Here is my code for anyone interested:

    jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function() {
    /**
    * data.view_unique_id (string) The View unique ID hash
    * data.layout (object) The jQuery object for the View layout wrapper
    */
    
    jQuery(".collapseomatic_content").each(function() {
    var this_section = jQuery(this);
    var any_checked = this_section.find("input[type='checkbox']:checked").length;
    
    console.log(any_checked);
    
    if( any_checked > 0 ) {
    this_section.show();
    } else {
    this_section.hide();
    }
    });
    });

    Also, I just posted a review recommending your plugin. Thanks for your work on this – and I appreciate the support follow up!
    http://wpdecoder.com/plugins/collapsing-toolset-filters-with-the-collapse-o-matic-plugin/

    Plugin Author twinpictures

    (@twinpictures)

    Fantastic! Very well done and love the tutorial/review!
    Thank you for marking the issue as resolved.
    Make it a great day.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Have collapse stay open when ajax option selected’ is closed to new replies.