select with images

main
alexanderroese 2024-07-17 22:33:06 +02:00
parent 2bca3995ae
commit 2beec1b38b
1 changed files with 4 additions and 10 deletions

View File

@ -618,21 +618,17 @@
//document.getElementById("shx-custom-enhanced-dropdown-variant-selected-image").src = event.currentTarget.querySelector("img").src
// }
}
function loadCustomEnhancedDropdownSelectedValue() {
const selectElement = document.querySelector('.shx-custom-enhanced-dropdown-font-hide-dummy-select');
selectElement.value = document.getElementById('shx-custom-enhanced-dropdown-font-select-selected-value').innerText;
// Trigger change event
const eventChange = new Event('change', { bubbles: true });
selectElement.dispatchEvent(eventChange);
document.getElementById("shx-custom-enhanced-dropdown-font-select-selected-value").innerText = selectElement.value
};
function SHX_IFC_genDropdownSelect(inputID, labelText, inputName, inputVal, options, section_id) {
let html = `
<label class="form__label custom shx-ifc-form_label" for="${inputID}-label">${labelText}</label>
<div class="field custom">
<div class="field custom shx-custom-enhanced-dropdown-font-hide-dummy-select">
<select id="${inputID}" form="product-form-${section_id}" name="properties[${inputName}]" class="field__input shx-custom-enhanced-dropdown-font-hide-dummy-select" style="height: 40px" onchange="document.querySelector('shx-input-forms').renderView(500)">
`;
@ -692,9 +688,7 @@
console.log("customDropdownHtml", customDropdownHtml)
setTimeout(() => {
loadCustomEnhancedDropdownSelectedValue()
}, 1000)
loadCustomEnhancedDropdownSelectedValue()
return html;
}