Is this possible with Dynamic Collapse

Is it possible on a page where you have a lot of Dynamic Collapses to do the following:
When a button is pressed it closes all open Collapses and then opens just the selected one.

I am currently do this by the on action click and hiding each collapse and then showing the one I want, but is there a way to make this a little easier by just closing them all. Because if I add another collapse then I have to go through all the others to make sure its added in there.

Hi Peter,

Yes, there is absolutely a better way! What you are describing is often called an accordion. If you assign the same parent to all the accordions, all will close except for the one clicked.

You can see here 4 dynamic collapse containers, but each of them has the same Parent value, which is the id of the Accordion cards parent.

–Ken

1 Like

I did look at this but, I need to control it from buttons in another column and not clicking the card.
So is there a way to control these from the buttons??

Sure…

Ken, I have a client who wants to have a table list of jobs and a button to reveal the status of the job below the row.

I tried to use a modal, but he wants it to drop (ease) down inside the row to reveal a form to manage the status of the job in the list.

Hi J.R. it does sound like you need a dynamic collapse. Did you have a question about that?

The terminology is not my forte. But yes, I do have a question.

I have a table that lists records of job assignments. I need an inline form that drops down or eases down under the corresponding row of the table. Do you believe that is possible? Below is an image of the current table:

I need this to drop down below a row of the above data:

Yes, that is possible…give it a try.

I will give it a go… thanks!

Ken, if I name all the collapse IDs the same, and they are all in a repeat region of a table, how do I name them to only allow one at a time to be opened?

Currently, they all toggle independently, i.e., if I toggle the button it will open and close each.

And since the name is repeated in each row of the table, will this keep the activation buttons working properly, i.e., One open at a time, and all others closed?

Jon does a good job of explaining here:

1 Like