业务要求,直接在table里面修改数据,并保存到数据库。
级联查询主要是通过change事件来变化
点击出现行编辑:
$("#jqGrid").jqGrid(
{
url: "${pageContext.request.contextPath}/admin/tlocks_installTlocksList.action",
mtype: 'POST',
datatype: "json",
height: 350,
autowidth: true,
shrinkToFit: true,
rowNum: 10,
rowList: [10, 20, 30],
colNames: ['序号', 'PID编号', '类型', '楼栋', '单元', '门禁名称','操作'],
colModel: [{
name: "SID",
index: "SID",
key: true,
hidden: true
}, {
name: 'PID',
index: 'PID',
}, {
name: 'TYPE',
index: 'TYPE',
editable: true,
formatter:'select',
edittype:'select',
editoptions: {value:"0:单元门禁;1:公共门禁"},
},{
name: 'BUILDING',
index: 'BUILDING',
editable: true,
formatter:'select',
edittype:'select',
editoptions:{value:getBudiling()},
},{
name: 'UNIT',
index: 'UNIT',
editable: true,
formatter:'select',
edittype:'select',
editoptions:{value:getUnit()},
},{
name: 'NAME',
index: 'NAME',
editable:true,
edittype:"text",
},{
name: 'BU',
index: 'BU',
}],
sortname: 'sid',
rownumbers: true,
jsonReader: {
root: 'rows',
page: "page",
total: 'total',
records: "records",
repeatitems: false
},
pager: "#jqGrid_paper",
viewrecords: