Adaptive Form - Collapse All Accordion Panels

Avatar

Avatar

James_R_Green

Avatar

James_R_Green

James_R_Green

15-06-2017

Hi,

I have a form that is using the out of the box accordion layout on a panel with 5 sub-panels underneath.

When I load the form the first sub-panel is set to active and is opened automatically. This is useful most of the time, however I would like to know if it is possible to collapse all of the panels programatically (or via a setting)?

I have tried using the guidebridge api setFocus to focus on a button at the button of the form when the form initialises, but this did not work (as I think the focus may be handled after the init?).

I am also aware that I can setFocus to another panel (rather than the first panel), but this isn't what I am after.

Can anyone think of another way to collapse all the panels on the accordion when the form is loaded?

Thanks,

Jim

View Entire Topic

Avatar

Avatar

James_R_Green

Avatar

James_R_Green

James_R_Green

23-06-2017

Hi Darren,

This is the route we went down too. We are just removing the active class when the form is loaded. If we run into problems with this approach we will change it, but it is fine for now:

var collapseAccordion = function (){

  $("div[id$=_guide-item]").removeClass("active");

};

Cheers,

Jim