sort vendors alphabetically in the dropdown list
This commit is contained in:
parent
bce2ad2ed8
commit
3253e7d407
@ -97,13 +97,15 @@ function populateVendorDropdown(data, selectedSmId = null) {
|
|||||||
? (weightInKg / 1000).toFixed(2) + " t"
|
? (weightInKg / 1000).toFixed(2) + " t"
|
||||||
: weightInKg.toFixed(2) + " kg";
|
: weightInKg.toFixed(2) + " kg";
|
||||||
|
|
||||||
// Dropdown mit gefilterten Herstellern befüllen
|
// Dropdown mit gefilterten Herstellern befüllen - alphabetisch sortiert
|
||||||
Object.entries(filteredVendors).forEach(([id, name]) => {
|
Object.entries(filteredVendors)
|
||||||
const option = document.createElement("option");
|
.sort(([, nameA], [, nameB]) => nameA.localeCompare(nameB)) // Sort vendors alphabetically by name
|
||||||
option.value = id;
|
.forEach(([id, name]) => {
|
||||||
option.textContent = name;
|
const option = document.createElement("option");
|
||||||
vendorSelect.appendChild(option);
|
option.value = id;
|
||||||
});
|
option.textContent = name;
|
||||||
|
vendorSelect.appendChild(option);
|
||||||
|
});
|
||||||
|
|
||||||
document.getElementById("totalSpools").textContent = totalSpools;
|
document.getElementById("totalSpools").textContent = totalSpools;
|
||||||
document.getElementById("spoolsWithoutTag").textContent = spoolsWithoutTag;
|
document.getElementById("spoolsWithoutTag").textContent = spoolsWithoutTag;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user