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