I am having issues populating a dropdown list with a JSON List.
Here is what I am doing in my function.
onPhaseChange1: function(dropdown, row) {
var combobox = $(dropdown);
comboboxWorkUnit = row.find("select.workUnit");
EmployeeType = $("input[id*='EmployeeType']").val();
comboboxWorkUnit.show();
comboboxWorkUnit.empty();
var jsonList = {
[{ "Id": "12345", "WorkUnitId": "SR0001954", "Description": "Test Service Request From Serena", "WorkUnitCategory": "ServiceRequest" },
{ "Id": "12355", "WorkUnitId": "WOR001854", "Description": "Test Work Order From Serena", "WorkUnitCategory": "ServiceRequest" },
{ "Id": "12365", "WorkUnitId": "DBR001274", "Description": "Test Database Related Service Request From Serena", "WorkUnitCategory": "ServiceRequest"}]}
$($.parseJSON(jsonList)).map(function() { $('<option>').val(this.Id).text(this.Id).appendTo(comboboxWorkUnit); });
},
Your jsonList should just be an array. It doesn’t need to be in an object. Then call each on the array. fiddle: http://jsfiddle.net/brentmn/Jkxe2/