trigger action
Action::make('preview')
->label('プレビュー')
->icon('heroicon-o-eye')
->color('gray')
->extraModalWindowAttributes(['class' => 'upload_cover_image'])
->modalHeading('')
->modalContent(fn($record): View => view(
'test',
['record' => $record],
)),
I have the above action in the action table.
In the modal of the above action there is a button as below
<button wire:click="showFieldEditor(3)"
style='color: #ffffff; font-weight: bold; background: #33456E; border-radius: 6px; padding: 6px 45px; font-size: 14px'>
編集する
</button>
When i press this button i want another action to be executed (this frozen action is also writing in the table action) i tried other ways but only the action preview is closed, but the action is not executing according to its mode

7 Replies
No form is set in preview so just the action() if it has one would be triggered. You need to define an ->action() and a ->form() for a modal last time I checked.
I want to reuse the upload music action so that when I click the button, the action will work.
But the action won't work at all without the functions being defined
I don't quite understand, can you explain more? Thanks.
in the above you have 'Action::make('preview')' this doesn't have an ->action() or a ->form(). So it will not show a modal and won't run any code... If you want to show a modal, add
and
ah, this Action I just need to enable 1 modal to display view<
In that view I have 1 button, the problem is I can't handle when clicking the button then action upload_music runs
Add an event listener?