Hi ,
I have a dropdown and data is coming from VDE in JSON format. I have added values and unit in the dropdown list. But need to add icons and N/P value in the dropdown . So in the dropdown i need to add container(div/span) for adding icon and P/N value. Kindly help me
The code i am using is :
Thanks in advance
I have a dropdown and data is coming from VDE in JSON format. I have added values and unit in the dropdown list. But need to add icons and N/P value in the dropdown . So in the dropdown i need to add container(div/span) for adding icon and P/N value. Kindly help me
The code i am using is :
HTML:
<select id="UP_AFDuration_vals" class="PD_active_main editRPFlag Displayable Selectable ApplicableAtInitialInterrogation Applicable PreviouslyApplicable ApplicableAfterProgram" onchange="hightlightAutoManualValues(this)" style="display: inline-block;"><option value="0.5">0.5 min</option><option value="1">1 min</option><option value="2" selected="">2 min</option><option value="6">6 min</option><option value="10">10 min</option><option value="20">20 min</option><option value="30">30 min</option><option value="60">60 min</option></select>
JavaScript:
function defineUpValOpts(upValList, selectedVal) {
var upOptArray = [];
if (upValList !== undefined && upValList.length != 0) {
for (var i = 0; i < upValList.length; i++) {
var optTxt;
var optVal;
var upOpt;
// evaluate drop-down value for special handling of "DOUBLE" value
processParamValue(upValList[i]);
if (upValList[i].unit) {
optTxt = upValList[i].parameterValue + ' ' + upValList[i].unit;
} else {
optTxt = upValList[i].parameterValue;
}
optVal = upValList[i].parameterValue;
if (upValList[i].parameterValue === selectedVal) {
upOpt = new Option(optTxt, optVal, true, true);
} else {
upOpt = new Option(optTxt, optVal);
}
upOptArray.push(upOpt);
}
} else {
console.warn('List of values, for defining a UPs Option List, was null or empty');
}
return upOptArray;
}
Thanks in advance