Hello,
I have a simple dropdown and I update the value of the id in the code but the value is not reflected, the code is below, some help would be appreciated. (The dropdown I am trying ot update is regulation)
<DropDownList
disabled={modelDropDownDisable}
data={compModelData}
onChange={(e) => {
setCompModelText(e.target.value);
const compressorModelSelected = compressorsModelData.filter(function(elem) {
//return false for the element that matches both the name and the id
return (elem.fk_brand_id == compBrandId.id && elem.comp_model == e.target.value)
});
if(compressorModelSelected.length>0) {
debugger
setCompressorModelSelectedRegulation(compressorModelSelected[0].fk_comp_regulation_id);
}
}
}
value={compModelText}
/>
<DropDownList
value={compressorModelSelectedRegulation}
textField="text"
dataItemKey="id"
onChange={(e) => {
setCompressorModelSelectedRegulation(e.target.value);
}}
data={compRegulations}
/>