I have the following request in JSON: the selected option does not work in IE, working in firefox.
I have an example of data such as:
var columnDefs = [... {"name":"childPerformancePrice", "label":"Cosell Price", "type":"int", "control":"select", "options":performancePrices, "align":"left", "default":"", "required":false,"size": 6}, ...]
Performance dropdown list, for example:
function getPerformancePrices(){ ...... $.getJSON("?data=performancePrices", function(list) { performancePrices.push([0, ""]); $.each(list, function(index, item) { performancePrices.push([item.id, item.description]); performancePrices.sort(); }); ... }); }
For example, JSON data such as JSON.stringify(columnDefs[index]) :
{"name":"childPerformancePrice", "label":"Cosell Price", "type":"int", "control":"select", "options":[[0,""],[15000,"Band 1"],[15001,"Band 2"],[15002,"Band 3"]],"align":"left", "default":"", "required":false,"size": 6}
Question: why the parameter selected below does not work during editing (i.e. is not correctly selected in IE) in IE, works well in Firefox?
function selectCell(oColumnDef, value) { var oSelect = createNamedElement("select", oColumnDef["name"]); if (value == undefined) { value = ""; } $.each(oColumnDef["options"], function(index, item) { var oOption = document.createElement("option"); oOption.value = item[0]; oOption.text = item[1]; if (item[1] == value) { oOption.selected = true; } oSelect.options.add(oOption); });