I am getting an unusual response from a jQuery to populate a select List. firstly, here is the ajax call;
loadShowAllReports = function() {
$.ajax({
url: "cfc/Reports.cfc"
, type: "get"
, dataType: "json"
, data: {
method: "jGetShowAll"
},
success: function(response) {
console.log(response);
$.each(response.DATA, function(i, row) {
// get value of first row as description;
var val = row[0];
var descr = row[1]
// append new options
$("##cboShowAllReports").append($("<option/>", {
value: val,
text: descr
}));
// set it while firing, so its available when done
// 1 = default 'Active' to start with
});
$('##cboShowAllReports option:selected').val(getValue('rShowAll'));
loadReports($(this).find(':selected').val());
loadReportsActive();
loadReportTypes();
},
error: function(msg) {
console.log(msg);
}
});
That should return 3 simple value-pairs Active, InActive and All, yet the first value is [object Object]. I have several other populated dropdowns on this page, but two of them are being created with this [object Object]. The getValue() is a coldfusion sessionMgr.cfc that gets and sets session variables.
I thought it was populating the [COLUMNS] data until I dumped to the console.log and the array looks fine. I am unsure what is doing this, any help? I have been fighting this for days and have run out of ideas.
so I added console.log('on population: ' + var); and it shows;