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

View File

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