diff --git a/Livewire/FacilityType/FacilityTypeModal.php b/Livewire/FacilityType/FacilityTypeModal.php index 8b60c46..28efc7b 100644 --- a/Livewire/FacilityType/FacilityTypeModal.php +++ b/Livewire/FacilityType/FacilityTypeModal.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/facility_types/index.blade.php b/Resources/views/parameter/facility_types/index.blade.php index f8d73b0..a73658e 100644 --- a/Resources/views/parameter/facility_types/index.blade.php +++ b/Resources/views/parameter/facility_types/index.blade.php @@ -92,6 +92,11 @@ LaravelDataTables['facility-type-table'].ajax.reload(); }); }); + + $('#kt_modal_add_facility_type').on('hidden.bs.modal', function () { + $(this).find('form').trigger('reset'); + Livewire.dispatch('reload', false); + }) @endpush