我们如何更新对 jqgrid 中特定行的单元格所做的更改....我想将其更新到数据库...我使用内联编辑进行编辑..我想将该特定行更新到数据库中用户做出的改变
这是我的jQuery代码
<script type="text/javascript">
$(function () {
var lastsel;
jQuery("#list").jqGrid({
url: '/Home/GetStudents/',
datatype: 'json',
mtype: 'POST',
colNames: ['StudentID', 'FirstName', 'LastName', 'Email'],
colModel: [
{ name: 'StudentID',sortable: false,key:true },
{ name: 'FirstName' },
{ name: 'LastName', sortable: false},
{ name: 'Email', width: 200, sortable: false}],
cmTemplate: {align: 'center', editable: true},
pager: '#pager',
width: 750,
rowNum: 15,
rowList: [5, 10, 20, 50],
sortname: 'StudentID',
sortorder: "asc",
viewrecords: true,
caption: ' My First JQgrid',
onSelectRow: function (StudentID) {
if (StudentID != lastsel) {
jQuery('#list').jqGrid('restoreRow', lastsel);
jQuery('#list').jqGrid('editRow', StudentID, true);
lastsel = StudentID;
}
},
editurl: '/Home/About/',
caption: "Using events example"
});
jQuery("#list").jqGrid('navGrid', "#pager", { edit: false, add: false, del: false });
});
</script>