I want to populate a jqGrid cell dropdownlist when I click the row. I am clicking the row but the dropdownlist isn't getting populated.
The code which I have written for populating the dropdownlist on edit or clicking the row is:
colModel: [
{ name: 'Emp_code', width: 50, sortable: false, align: "center" },
{ name: 'Emp_name', width: 200, sortable: false },
//{ name: 'totalhours', width: 100, sortable: false, align: 'center', editable: true, edittype: "select", editoptions: { value: "1:1;2:2;3:3;4:4;5:5;6:6;7:7;8:8;9:9"} }
{name: 'totalhours', index: 'totalhours', width: 100, sortable: false, align: 'center', editable: true, edittype: "select",
editoptions:
{
dataInit: function(elem) {
$(elem).empty()
.append($('<option></option>').val("1").html("Apples"))
.append($('<option></option>').val("2").html("Oranges"));
}
}
}
],
I want to populate the totalhours column on row click which would populate with apple and oranges, but somehow I am getting blank dropdowns. On row click the dropdown is shown but it's not populated.