update to select2

This commit is contained in:
Daeng Deni Mardaeni 2023-11-23 17:49:54 +07:00
parent 1a2107df29
commit 514cc48e9a
2 changed files with 37 additions and 27 deletions

View File

@ -40,8 +40,8 @@
<label class="required fw-semibold fs-6 mb-2">Cabang</label>
<!--end::Label-->
<!--begin::Input-->
<select wire:model.defer="branch_id" name="branch_id" class="form-control form-control-solid mb-3 mb-lg-0">
<option value="">Pilih Cabang</option>
<select wire:model.defer="branch_id" data-control="select2" data-dropdown-parent="#kt_modal_add_rekening" data-placeholder="Pilih Cabang" name="branch_id" class="form-select form-select-solid mb-3 mb-lg-0">
<option></option>
@foreach($cabang as $item)
<option value="{{ $item->id }}">{{ $item->kode }} - {{ $item->name }}</option>
@endforeach
@ -57,8 +57,8 @@
<label class="required fw-semibold fs-6 mb-2">Debitur</label>
<!--end::Label-->
<!--begin::Input-->
<select wire:model.defer="debitur_id" name="debitur_id" class="form-control form-control-solid mb-3 mb-lg-0">
<option value="">Pilih Debitur</option>
<select wire:model.defer="debitur_id" data-control="select2" data-dropdown-parent="#kt_modal_add_rekening" data-placeholder="Pilih Debitur" name="debitur_id" class="form-control form-control-solid mb-3 mb-lg-0">
<option></option>
@foreach($debitur as $item)
<option value="{{ $item->id }}">{{ $item->kode }} - {{ $item->name }}</option>
@endforeach
@ -74,8 +74,8 @@
<label class="required fw-semibold fs-6 mb-2">Produk</label>
<!--end::Label-->
<!--begin::Input-->
<select wire:model.defer="product_id" name="product_id" class="form-control form-control-solid mb-3 mb-lg-0">
<option value="">Pilih Produk</option>
<select wire:model.defer="product_id" data-control="select2" data-dropdown-parent="#kt_modal_add_rekening" data-placeholder="Pilih Produk" name="product_id" class="form-select form-select-solid mb-3 mb-lg-0">
<option></option>
@foreach($product as $item)
<option value="{{ $item->id }}">{{ $item->kode }} - {{ $item->name }}</option>
@endforeach
@ -91,8 +91,8 @@
<label class="required fw-semibold fs-6 mb-2">Mata Uang</label>
<!--end::Label-->
<!--begin::Input-->
<select wire:model.defer="currency_id" name="currency_id" class="form-control form-control-solid mb-3 mb-lg-0">
<option value="">Pilih Mata Uang</option>
<select wire:model.defer="currency_id" data-control="select2" data-dropdown-parent="#kt_modal_add_rekening" data-placeholder="Pilih Mata Uang" name="currency_id" class="form-select form-select-solid mb-3 mb-lg-0">
<option></option>
@foreach($currency as $item)
<option value="{{ $item->id }}">{{ $item->kode }} - {{ $item->name }}</option>
@endforeach
@ -126,6 +126,8 @@
<span class="text-danger">{{ $message }}</span> @enderror
</div>
<!--end::Input group-->
<div class="row mb-7">
<div class="col-6">
<label class="fw-semibold fs-6 mb-2">Status Rekening</label>
<div class="form-check form-switch form-check-custom form-check-solid mb-5" style="display: block!important;">
<input class="form-check-input h-20px w-30px me-5" type="checkbox" wire:model.defer="status_rekening" id="status_rekening" name="status_rekening"/>
@ -135,7 +137,8 @@
@error('status_rekening')
<span class="text-danger">{{ $message }}</span> @enderror
</div>
</div>
<div class="col-6">
<label class="fw-semibold fs-6 mb-2">Status Data</label>
<div class="form-check form-switch form-check-custom form-check-solid" style="display: block!important;">
<input class="form-check-input h-20px w-30px me-5" type="checkbox" wire:model.defer="status" id="status" name="status"/>
@ -145,7 +148,8 @@
@error('status')
<span class="text-danger">{{ $message }}</span> @enderror
</div>
</div>
</div>
</div>
<!--end::Scroll-->
<!--begin::Actions-->

View File

@ -66,6 +66,12 @@
window.LaravelDataTables['rekening-table'].ajax.reload();
});
});
$(function(){
$('#kt_modal_add_rekening').on('hidden.bs.modal', function () {
$(this).find('form').trigger('reset');
})
});
</script>
@endpush