0

我正在使用 jqgrid。我想添加记录内联导航现在我想在行字段中添加选择框。怎么可能?我使用 Ajax 从数据库中获取数据,我想将这些数据添加到选择框中。怎么可能?请帮助我的 Ajax 代码

$.ajax({
 url : "getAllWards.html",
 data : "&time=" + new Date().getTime(),
 type : 'GET',
 dataType : 'JSON',
 success : function(data) {}
});

我的 JqGrid 代码

jQuery("#room").jqGrid(
{
 mtype : 'GET',
 url : "listAllRooms.html",
 colModel : [ .....,
 ,{
name : 'wardType',
index : 'wardType',
width : 150,
edittype: "select",
editrules: { required: true },
editoptions: { size: 71},
editable:true,
}],
4

1 回答 1

1

If you want use edittype: "select" you should specify value or dataUrl property of editoptions.

The demo provide as example.

UPDATED: It seems to me that you should better use dataUrl with probably buildSelect for formatting. See the answer and another one.

于 2012-10-26T07:40:36.597 回答