F
Filament•2y ago
Jo

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 ServicePeriodI 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
Jota Ele
Jota Ele•2y ago
i have the same problem 😦
awcodes
awcodes•2y ago
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.
Dan Harrin
Dan Harrin•2y ago
how about using a Repeater relationship() inside the modal?
Vulcan
Vulcan•2y ago
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
Dan Harrin
Dan Harrin•2y ago
blame browsers for not supporting nested <form> elements yet
Want results from more Discord servers?
Add your server