Collapse/Expand Repeating Group

I have a repeating group-B inside another repeating group-A with a collapse button which hides repeating group-B. But when I hide repeating group-B I would like repeating group-A to collapse, hiding all the white space that now exists. However repeating group-A doesn’t shrink.

Is there a way to accomplish this?

Editor view

Result

Thanks

2 Likes

Put the inner RG in a group, set to collapse on hide. Then hide the group, not the RG.

8 Likes

Hi,
you can use the Group element, inside which you put your second RG. Set the Group’s thing to the same as parent cell. Then your inside RG to take data from the Group.
Now, for the group set “Collapse this element’s height when hidden” (you can also animate it!). And change your button’s action to show/hide Group, not the second RG.

Here working sample:
https://obiwan.bubbleapps.io/version-test/collapse_rg?debug_mode=true

edit
@NigelG was faster :smiley:

3 Likes

Yes @NigelG was faster, and correct :slight_smile: However you solved what I was trying to figure out next. Your example works exactly like what I need, but I don’t understand yet how to make i happen. Would you mind showing me how exactly?

Thanks!

Thanks Nigel! Worked perfectly.

Editor link:
https://bubble.io/page?type=page&name=collapse_rg&id=obiwan&tab=tabs-1

See the elements on the page (i colored each), their properties, and let me know if you have questions.

4 Likes

Thanks obiwan. Such a fast response and I learned a new trick!

Thanks Obiwan. May you and Ezra return from the fringe!

1 Like

2 years on still learning from this

1 Like

Hi, can someone tell me how you able to add rows on the current cell repeating group B without adding them on other cells repeating group B. Thank you.

Hi @albinojosephchristia,
You can hide the element if the current cell index is not 1.
That way the element would only show if it’s the first cell.

You can search the forum about this, there are others explaining this with more details if needed :slightly_smiling_face:

1 Like

my follow up question is, how to avoid datas in the inner repeating group be mirrored on other inner repeating groups? Sorry for my very confusing question…

We’d need more details, especially design and data sources.

Hi, I was able to successfully done this. I create an invisible(not editable) text that contains the uniqueId of the main cells. Then the collected uniqueId of the main cell will serve as a parent for the datas inside my inner repeating group. I may have done it the wrong way, but it worked. :smile:

If it works… it works! :grin: