1
我想从内嵌JqGrid中的MVC操作控制器绑定数据列表。示例JSON数据如下内联Jqgrid下拉绑定问题
{Id:"1",FirstName:"Joy",Gender:"Male"},
{Id:"2",FirstName:"George",Gender:"Male"},
{Id:"3",FirstName:"Tessa",Gender:"Female"}
我想在内联JqGrid中绑定性别的下拉列表。下拉列表的样本数据如下。
{Id:"17b4bf97-4ab0-49b1-ab01-072f4dbed696",Gender:"Male"},
{Id:"f206d222-0608-4b92-b9dd-0cac5c66121",Gender:"Female"}
我已经配置的jqGrid如下
$("#tbl-users").CreateGrid({
url: // MVC controller action url,
colNames: ['User ID', 'First Name', 'Gender',....],
colModel: [
{ name: 'UserID', index: 'UserID', sorttype: 'integer', hidden: true, key: true },
{name: 'UserName', index: 'UserName', searchoptions: { sopt: ['cn'] }, editable: true},
{name: 'Gender', index: 'Gender', searchoptions: { sopt: ['cn'] }, editable: true,
edittype: "select",
formatter: 'select',
editoptions: {
dataUrl: // Url to get the list of Gender User from the MVC controller,
buildSelect:
function (response) {
//Code to build a drop down
}
}
},
});
上配置如上我不能够以显示我的列表中的性别价值。我错过了什么?如果我得到任何人的指导,这将会有所帮助。 我正在使用JqGrid 4.5.1
非常感谢..你拯救了我的整个一周。:-) –