So i have a function that creates options for a selected menu. I call this function in a cellrenderer. I want to take the value of the selected element of the dropdown.
var renderlist = function (row, column, value) {
var buildList = '<select id="Select' + row + '" onChange="selectionChanged(event)">';
for (var i = 0; i < dataSource.length; i++) {
if (value == dataSource[i]) {
buildList += '<option selected="true">' + dataSource[i] + '</option>';
}
else {
buildList += '<option>' + dataSource[i] + '</option>';
}
}
buildList += '</select>';
return buildList;
};
Here is my function.
And here is my column.
columnObj = {
text: colCounter,
datafield: "Dropdown" + i,
editable: false,
width: 60,
cellsrenderer: renderlist
};