extraModalFooterActions issues when has form in bulkaction
hi guys i have extraModalFooterAction and inside it there is a form and it is working with normal action but with bulk action new modal form not appearing ??
12 Replies
Tables\Actions\BulkAction::make('pass')
->requiresConfirmation()
->label('النقل')
->modalHeading('نقل للمرحلة التالية')
->modalSubmitActionLabel('النقل')
->modalCancelAction(false)
->modalDescription('تستطيع النقل للمرحلة القادمة وإشعار المتقدم بذلك')
->icon('heroicon-s-check')
->modalIcon('heroicon-s-check')
->visible(fn ($livewire): bool => $livewire->activeTab !== 'accept')
->hidden(function (Application $record) {
return $record->deleted_at;
})
->extraModalFooterActions(
[
Tables\Actions\Action::make('message')
->modalHeading('اكتب ماتود ارسالة؟')
->label('نقل وارسال رسالة')
->color('gray')
->modalSubmitActionLabel('النقل وارسال الرسالة')
->form(
[
RichEditor::make('messages')->required()->label('الرسالة')
]
)
->closeModalByClickingAway(false)
->action(function ($data, Collection $records) {
$arr = [];
$title = null;
foreach ($records as $record) {
$title = $title ?? $record->program->name;
if (!$record->deleted_at) {
$arr[] = $record->applicant->user->email;
$record->status_id++;
$record->save();
}
}
Mail::send(new \App\Mail\notification($arr, $title, $data));
})
->cancelParentActions(),
]
)
->action(function (Collection $records) {
foreach ($records as $record) {
if (!$record->deleted_at) {
$record->status_id++;
$record->save();
}
}
})
->deselectRecordsAfterCompletion(),
any help welcome
it is not working because i find Tables\Actions\Action::make('message') and now i replace it to Tables\Actions\BulkAction::make('message') and sadly it still not working but the one different it there is some overlay appearing and previous not happen any one faced problem like this please help ??
what is the error msg or a screenshot of the issue
when click extraModalFooterAction button this overlay appear and nothing also
but when deal with normal action every thing goes well
any console log errors?
no nothing
can you please format your code use and add php
as mentioned here
https://discord.com/channels/883083792112300104/883264995603935272
this will help me copy and past your code and make it easier to debug and help you
php
Tables\Actions\BulkAction::make('pass')
->requiresConfirmation()
->label('النقل')
->modalHeading('نقل للمرحلة التالية')
->modalSubmitActionLabel('النقل')
->modalCancelAction(false)
->modalDescription('تستطيع النقل للمرحلة القادمة وإشعار المتقدم بذلك')
->icon('heroicon-s-check')
->modalIcon('heroicon-s-check')
->visible(fn ($livewire): bool => $livewire->activeTab !== 'accept')
->hidden(function (Application $record) {
return $record->deleted_at;
})
I don't think nested modal works with bulk actions
your code is working fine as an action
you can change your approach, why you need the nested action?
you can use multiple bulk actions
in my example you can take action for multi records and another option is required form to take action to multi records
i guess it the problem from bulkaction but i think this it is bug
if you think it's a bug I recommend to PR it or open a github issue
thanks @Lara Zeus