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