In my app, I have groups containing items, and also containing subgroups (containing other items and maybe other subgroups).
I keep track of the order of items and subgroups within groups with an order field.
Items are related to their group through a “parent group” field, of type group.
Groups which are sub groups also have a parent field, type group.
As far as I know, Bubble only allows to list one type of thing in a repeating group : ie, either items or groups. I can display all items of a group, or all subgroups of a group.
How can I display both groups and items belonging to the same group, respecting their order ?
OK the solution I was hoping for is not working right now.
So here is a picture to illustrate the data layout I am trying to make :
Groups can contain both items and subgroups. Subgroups can contain both items and subgroups.
Groups and subgroups will be collapsible.
Groups and items would be draggable for easy reorder.
As repeating groups only work with a single type of data, I am a bit stuck.
I tried creating a single data type containing both items and groups with is_group field, but this prevents from grouping items within subgroups (unless there is a way to do this).
Thanks for the headache To be honest I’m having a hard time figuring out what you’re trying to do. Maybe share your editor in view mode if you’re comfortable doing that or include screenshots
I would tackle this differently and just work with the one data type.
Fundamentally it is a RG of items within an RG of items.
I would add 2 more field to Items, to allow an item to also be a parent ‘group’ item, or child item, instead of just a normal item. Then any Item that is a child item should have a parent item specified.
your top RG shows the list of normal Items and parent groups, then your inner RG shows child items of the parent item.
RGs should be set to 1 high in the editor and set to full list.
@ambroisedlg unfortunately I have nothing interesting to share in my editor as I have not been able to build what I need but here is a more detailed view of my goal, I hope this helps :
It works to generate the list, but then I do not see how to recreate the groups to link items belonging to subgroups. All job content is considered equal, whether it is a group or item. Ie, I cannot drag and drop or change group attributes and hope that children items and group will follow.
My point goes back around to the fundamentals of bubble logic and how they work with the ‘thing’ abstraction for data. The point I was making is that all of your records are the same thing, items in your case, and you just store what type of thing they are, so Item, or group on their record, then you use that for the RG search. your top RG will be searching for anything in group A, and withing that RG you will have a hidden RG that is going to search for any thing that is marked for group B etc. I can testify to the fact the logic works as I have built a similar system before, although I would admit that its not the most efficient way of working with the data, however it works within the constrains of bubble.
Hey, you mentioned that the above solution of DAWN is working but that it is not the most efficient way. Would you have an example of the version you are mentioning in you post.