diff --git a/Livewire/GuaranteeType/GuaranteeTypeModal.php b/Livewire/GuaranteeType/GuaranteeTypeModal.php index 69b444f..72e2e67 100644 --- a/Livewire/GuaranteeType/GuaranteeTypeModal.php +++ b/Livewire/GuaranteeType/GuaranteeTypeModal.php @@ -21,6 +21,7 @@ protected $listeners = [ 'delete' => 'delete', 'update' => 'update', + 'reload' => 'reload', ]; public function render() @@ -142,6 +143,12 @@ } } + public function reload() + { + $this->edit_mode = false; + $this->reset(); + } + public function hydrate() { $this->resetErrorBag(); diff --git a/Resources/views/parameter/guarantee_types/index.blade.php b/Resources/views/parameter/guarantee_types/index.blade.php index 7e14df5..46e86fc 100644 --- a/Resources/views/parameter/guarantee_types/index.blade.php +++ b/Resources/views/parameter/guarantee_types/index.blade.php @@ -92,6 +92,11 @@ LaravelDataTables['guarantee-type-table'].ajax.reload(); }); }); + + $('#kt_modal_add_guarantee_type').on('hidden.bs.modal', function () { + $(this).find('form').trigger('reset'); + Livewire.dispatch('reload', false); + }) @endpush