This forum has moved to a new location and is in read-only mode. Please visit to access the new location.



I'm trying to set up a relation where an item belongs to a subgroup and the subgroup belongs to a maingroup. (generally speaking)

My objective is to display a list in backend where each item is displayed with its subgroup (this works with a belongsTo relation already) and the maingroup row by row. Should look like this:

| maingroup 1 | subgroup 1a | item aaa |
| maingroup 1 | subgroup 1b | item bbb |
| maingroup 2 | subgroup 2a | item ccc |
| maingroup 3 | subgroup 3a | item ddd |

and so on. Any ideas how to implement this?

[edit: of course the subgroup belongsTo maingroup relations works fine too already ]

Thanks in advance

Last updated


You would need three models, Item, Subgroup and Maingroup. Then set up the relationship types accordingly. Then you can include list columns against the Maingroup model.

  label: MainGroup Name

  label: Subgroup Name

  label: Item name

There will most certainly be some performance implications from this, so you should extend the list query to include the relationships as an eager load


Hope this helps

1-2 of 2

You cannot edit posts or make replies: the forum has moved to