|
|
|
@ -150,6 +150,7 @@ function getSatuan(){
|
|
|
|
|
|
|
|
|
|
// Clear the select element before appending new options
|
|
|
|
|
$('#uom-req-material').empty(); |
|
|
|
|
$('#uom-req-expense').empty(); |
|
|
|
|
|
|
|
|
|
// Append the new options to the select element
|
|
|
|
|
satuanList.forEach((option) => { |
|
|
|
@ -157,6 +158,11 @@ function getSatuan(){
|
|
|
|
|
$('#uom-req-material').append(newOption); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
satuanList.forEach((option) => { |
|
|
|
|
let newOption = new Option(option.label, option.label); |
|
|
|
|
$('#uom-req-expense').append(newOption); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// Initialize select2 on the select element
|
|
|
|
|
$('#uom-req-material').select2({ |
|
|
|
|
dropdownParent: materialModal, |
|
|
|
@ -164,6 +170,12 @@ function getSatuan(){
|
|
|
|
|
allowClear: true |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('#uom-req-expense').select2({ |
|
|
|
|
dropdownParent: expenseModal, |
|
|
|
|
placeholder: 'Pilih satuan', |
|
|
|
|
allowClear: true |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if(satuanList.length > 0){ |
|
|
|
|
gantt.updateCollection("satuan", satuanList); |
|
|
|
|
gantt.refreshData(); |
|
|
|
|