F
Filament4mo ago
Mateus

Action that opens a modal, where there are buttons that take you to other modals

I'm working on a modal, where inside it there are 2 buttons that take you to different modals. I'm using extraModalFooterAction to make my buttons to open the modals, I managed to open them, but when I fill everything in both modals it's not saving my data, I used cancelParentActions but I realized that it literally cancels my entire previous action, what can I do?
3 Replies
toeknee
toeknee4mo ago
You can't do anything..... except maybe onAction save?
Mateus
MateusOP4mo ago
Do you have a link to the documentation so I can analyze this? Now I'm doing something like this Main action where other actions are centralized ExtraModalFooterActions Action where pulls a modal Action whre pull another modal The first action has a ->action() to save the data from the main modal, just as the ->extraModalFooterActions acations have a ->action() for each modal
Hugo
Hugo3mo ago
I have the same question, is it possible to open a modal right after submiting the action? I tried
->action(function ($data, $arguments,$livewire, $action) {
if($arguments['withoutSizes'] ?? false){
$record = CreateArticleTypeAction::fromArray($data);
$livewire->dispatch('open-modal', 'create_sizes');
$livewire->mountTableAction('create_sizes', (string)$record->id);
}
})
->action(function ($data, $arguments,$livewire, $action) {
if($arguments['withoutSizes'] ?? false){
$record = CreateArticleTypeAction::fromArray($data);
$livewire->dispatch('open-modal', 'create_sizes');
$livewire->mountTableAction('create_sizes', (string)$record->id);
}
})
and it is not opening the modal, it just shows a gray overlay (like it is opening the modal) but the modal does not open, any suggestions if this is possible to do? right after posting this, I went and analyzed all the methods on the HasTable interface and replaced the
$livewire->mountTableAction()
$livewire->mountTableAction()
with
$livewire->replaceMountedTableAction('create_sizes', (string)$record->id);
$livewire->replaceMountedTableAction('create_sizes', (string)$record->id);
and it is working.
Want results from more Discord servers?
Add your server