Edit form for multiple tables #15058
-
Hi, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @Rickmh I've based the following on top of the app-export featured in the documentation that you posted. It's a little rough-around the edges, but you should hopefully get the picture. In the Jobs table, I've added a button that runs 3 actions - The first two set some For debugging purposes, on the new form screen, I've added a headline to display the The component tree starts to get a bit tricky here, but the reasons will become apparent. I've got a Data Provider fetching from the employee-table, filtering on the employee_id set in state. Inside that is a repeater (though there will only be one row returned) Inside that repeater, add a form and a field group - the field group will go and fetch the fields for your form according to the schema you set your form. Also in that repeater add another data provider, as a sibling of the form, nest another repeater, nest another form inside the repeater, and a field group inside that. These should all be set to Jobs. The Data Provider should be filtering the Jobs table based on the job Lastly, add a button to the field group of the inner-form. This will have access to both forms information. You can use it to save a row twice one for each table. Hopefully with this approach you can apply it to your specific use-case. |
Beta Was this translation helpful? Give feedback.
Hey @Rickmh
I've based the following on top of the app-export featured in the documentation that you posted. It's a little rough-around the edges, but you should hopefully get the picture.
In the Jobs table, I've added a button that runs 3 actions - The first two set some
_id
s in state (employee_id is fetched from the jobs assigned field), and the third navigates to a new page that contains a form.For debugging purposes, on the new form screen, I've added a headline to display the
_id
s passed in using state - you should delete these later, but it's helpful while you're still building.The component tree starts to get a bit tricky here, but the reasons will become apparent. I've got a Da…