行。我在这里经历了很多答案,但没有一个能奏效。我要做的是在JSON
中显示我的jqgrid
回复。但它显示了这个错误:
错误:
以下是代码:
var cols = ['VNo', 'Notes', 'Title'];
var colmodel = [
{ key: true, hidden: false, name: 'VNo', index: 'VNo' },
{ key: false, hidden: false, name: 'Notes', index: 'Notes' },
{ key: false, hidden: false, name: 'Title', index: 'Title' }
];
alert(colmodel.length);
$('#grid').jqGrid({
url: "/Voucher/GetJournalVouchers",
datatype: 'json',
mtype: "GET",
colNames:cols,
ColModel:colmodel,
pager: jQuery('#pager'),
rowNum: 10,
rowList: [10, 20, 30, 40],
height: '100%',
viewreocrds: true,
caption: 'Vouchers',
emptyrecords: 'No records to display',
jsonReader: {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
id: "0"
},
autowidth: true,
multiselect: false,
});
答案 0 :(得分:1)
在网格定义中将ColModel:colmodel,
更改为colModel:colmodel,
。这是一个法术错误。