Open modal before create action
Is it possible to :
1) open a modal with fields when initially pressing the create resource button?
The idea for this is to take in some contextual information (choosing a template for the form).
2) open a modal when form is submitted on create resource page before the resource is created. There will be an option on the modal to create a different resource upon creation.
I want to use the option to create a different resource.
5 Replies
Yes, I think you could use a regular action instead of
CreateAction
. Take the information you need in the action modal and save it in the session. Then redirect to your full Create page and fetch the data from the session in mount()
.Ok, will try that. And what about opening a modal at the end of the createaction?
Do you mean showing a modal when the user lands on the Create page?
Yes, either showing a modal when the user lands or when the user presses the create button. Ideally both
Ok. What I'm suggesting above is pretty much this (you can make the Action label say "New item"). If you want to show the modal when the Create page loads, I think you could do it with a hidden Form action, maybe. I'm not sure.