How to expand all Accordion Item when first load

How to expand all Accordion Item when first load

  

Hi All,

I have a few accordion items in the page, i would like to ask how to do i expand all the accordion items when the page is being loaded? And also provide an option if the user want to collapse back the accordion items.

So basically is expand all is the default setting. User can collapse back the accordion items.

Hello Jace,

The Accordions do not work this way.
When one open, the previous one that was opened closes. It keeps only 1 open at a time.

If you need a different behavior, with the possibility of open more than one at a time, you should use the Expandable Section. It has a property that says if it must be rendered open or closed.

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Hello Jace,

The Accordions do not work this way.
When one open, the previous one that was opened closes. It keeps only 1 open at a time.

If you need a different behavior, with the possibility of open more than one at a time, you should use the Expandable Section. It has a property that says if it must be rendered open or closed.

Cheers,
Eduardo Jauch

Hello Eduardo,

Noted on this. So i can use section expandable to achieve what i want to achieve?

To expand all and collapse all


Solution

Jace Jace wrote:


Hello Eduardo,

Noted on this. So i can use section expandable to achieve what i want to achieve?

To expand all and collapse all


Yes :)

With Expandable Section you can open all and close all.
In the IsExpanded property, you can use a boolean variable and control all at the same time.

Cheers,
Eduardo Jauch


Solution

Hello jace,

Do you need further assistance with this?

Cheers,

Eduardo Jauch

As a remark, after rendering the page, to dynamically close or open all at a time, you should run a JavaScript (attached to a button)  that changes the style of the expandable section content to hide it.


Hi, Im using Expandable section, but I need just to keep open 1 at a time (on mobile), can someone give me some light?


Thanks in advance.