インライン編集が正常に機能するjqgridがあります。私の要件は、studentIdの編集オプションを無効にすることです。そのstudentId列に対してeditable:falseを宣言しましたが、保存ボタンをクリックするとエラーが発生します...パラメーター ディクショナリには、メソッド .....' の null 非許容型 'System.Int32' のパラメーター 'StudentId' の null エントリが含まれています。
私のjquery
<script type="text/javascript">
$(function () {
var lastsel;
jQuery("#list").jqGrid({
url: '/Home/GetStudents/',
datatype: 'json',
mtype: 'POST',
colNames: ['StudentID', 'FirstName', 'LastName', 'Email', 'Actions', ],
colModel: [
{ name: 'StudentID', sortable: false, key: true,editable:false },
{ name: 'FirstName', key: true },
{ name: 'LastName', sortable: false, key: true },
{ name: 'Email', width: 200, sortable: false, key: true },
{ name: 'act', index: 'act', width: 75, sortable: false, editable: 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',
gridview: true,
width: 850,
gridComplete: function () {
var ids = jQuery("#list").jqGrid('getDataIDs');
for (var i = 0; i < ids.length; i++) {
var cl = ids[i];
be = "<input style='height:22px;width:20px;' type='button' value='E' onclick=\"jQuery('#list').editRow('" + cl + "');\" />";
se = "<input style='height:22px;width:20px;' type='button' value='S' onclick=\"jQuery('#list').saveRow('" + cl + "');\" />";
ce = "<input style='height:22px;width:20px;' type='button' value='C' onclick=\"jQuery('#list').restoreRow('" + cl + "');\" />";
jQuery("#list").jqGrid('setRowData', ids[i], { act: be + se + ce });
}
},