How to edit record using modal on the custom page?
Hello, I have a TaskResource with a custom page inside that called ScheduleTask.
Currently I can trigger a New Task Modal using
getActions()
function in the ScheduleTask page.
how can I trigger the edit modal with the form filled with the selected task when I click the individual task?3 Replies
Unfortunately that is not easy in v2, it will be in v3
you will need to create your own modal in the view and embed our form builder within it. you will need livewire and alpine knowledge
I tried this approach right now, Currently, I have implemented HasForms trait on ScheduleTask page
and I render the form below the calendar
I have also enabled the form to be filled when a task item is clicked. Now, I am looking for a way to show and hide the form using a modal. I have tried wrapping the form using x-filament::modal, but I am unsure how to toggle the visibility of the modal.
add:
`
Then in the page view wrap the modal display in:
@if($displayForm)
<Modal code here>
@endif