Hi paramquery team,
I have a colmodel which is having the select tag. I want load the options for the select tag by making ajax call and get the data. I am getting the data in response, but that response data i have to display like option for select tag.So can u please give some suggestion for my problem.
Here is my code.
var colM = [ {
title : "Event",
width : '25%',
align : "center",
dataIndx : "eventType",
editable : false,
editor : {
type : 'select',
cls: "eventlist",
options : function(ui)
{
var opts = [];
var options = ui.column.editor.options;
cellData = ui.cellData;
$.ajax ({
type : 'GET',
url : "getEventType",
success : function(response) {
alert(response);
var cjson = eval('(' + response
+ ')');
for (var i = 0; i < cjson.length; ++i) {
opts.push(cjson.eventDesc);
}
for (var i = 0; i < cjson.length; i++) {
var option = opts;
if (option[cellData]) {
return option[cellData];
}
}
},
error : function(e) {
alert(e);
},
});
alert(opts);
},
},
}]