单击该行时,我想填充一个 jqGrid 单元格下拉列表。我正在单击该行,但未填充下拉列表。
我为在编辑或单击行时填充下拉列表而编写的代码是:
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"));
}
}
}
],
我想在行单击时填充总小时数列,该列将填充苹果和橙子,但不知何故我得到了空白下拉列表。在行上单击下拉菜单会显示,但未填充。