Having a relation manager under the edit form in a modal of a relation manager
I have a model which is called
ServicePeriod
which hasMany
of another model called Slot
. I have set up the relation manager successfully, so if I go to the edit screen of ServicePeriod
I can see all of the related Slot
records in a list with edit and delete buttons, and I can click on them to get an edit form which appears in a modal. All good so far.
But each Slot
also hasMany
of another model called Sector
and I want a list of all of the Sector
records which are related to the Slot
record to be displayed under the Slot
edit form within the modal. Preferably I would like this to be the same style as the relation manager. I've obviously set up the getRelations()
inside the SlotResource
properly, but it isn't automatically showing under the edit form in the modal as it would do on a normal resource page.
Is this possible, or am I going beyond what it's supposed to do?5 Replies
i have the same problem đŚ
Donât think thatâs going to be possible in a modal. Youâd be getting into the territory of having nested forms which isnât allowed in html. Hopefully we can make it possible in v3.
For now you best better would be to have the slots link to their edit page where you could have a relation manager for its sectors.
how about using a Repeater relationship() inside the modal?
I'm pretty keen for something like this, but just in the view form.
Basically I'd love it if that relationship data table was actually in one of my tabs in the view page
blame browsers for not supporting nested <form> elements yet