如何在jqgrid中显示添加表单?
How to display add form in jqgrid?
$("#list_records").jqGrid({
url: "getGridData.php",
datatype: "json",
mtype: "GET",
colNames: ["UserId", "Mobile Number"],
colModel: [
{ name: "id",align:"right"},
{ name: "mobilenumber"}
],
pager: "#perpage",
rowNum: 10,
rowList: [10,20],
sortname: "id",
sortorder: "asc",
height: 'auto',
viewrecords: true,
gridview: true,
// editurl: 'getGridData.php'
caption: ""
});
jQuery("#list_records").jqGrid('navGrid','#perpage',{edit:true,add:true,del:true});
它工作正常,当我单击添加按钮时,将打开 就像 this.How 以在其中添加文本框 form.when 我添加编辑 url 工作页面将显示为空白页..
您应该在 colModel
的所有列中添加 属性 editable: true
,您希望允许对其进行编辑。例如你可以使用
colModel: [
{ name: "id", align:"right" },
{ name: "mobilenumber", editable: true }
]
$("#list_records").jqGrid({
url: "getGridData.php",
datatype: "json",
mtype: "GET",
colNames: ["UserId", "Mobile Number"],
colModel: [
{ name: "id",align:"right"},
{ name: "mobilenumber"}
],
pager: "#perpage",
rowNum: 10,
rowList: [10,20],
sortname: "id",
sortorder: "asc",
height: 'auto',
viewrecords: true,
gridview: true,
// editurl: 'getGridData.php'
caption: ""
});
jQuery("#list_records").jqGrid('navGrid','#perpage',{edit:true,add:true,del:true});
它工作正常,当我单击添加按钮时,将打开
您应该在 colModel
的所有列中添加 属性 editable: true
,您希望允许对其进行编辑。例如你可以使用
colModel: [
{ name: "id", align:"right" },
{ name: "mobilenumber", editable: true }
]