第一次单击编辑一行效果很好,但在关闭对话框并单击另一行编辑按钮后,它会抛出异常(在主题中)。 调试时我在jquery.min.js中看到“#”符号崩溃,我猜它会以某种方式得到这个无效字符。代码:
$("#jqgrid").jqGrid({
datatype: "local",
mtype: 'GET',
colNames: ['Pic', 'Category', 'Order', 'Name', 'Description', 'Full Price', 'Price', 'Is Pack', 'Is Active', 'Is Shipment', 'Is Pack Only', 'Attributes', 'Sites', 'Call Centers', ''],
colModel: [
{ name: 'PictureUrl', index: 'PictureUrl', width: 40, formatter: imageFormatter, align: 'center' },
{ name: 'CategoryID', index: 'CategoryID', width: 60, editable: true, editoptions: { size: 30, value: getProductCategories }, edittype: "select" },
{ name: '', index: 'ProductID', width: 40, editable: true, editoptions: { size: 30} },
{ name: 'ProductName', index: 'ProductName', width: 40, editable: true, editoptions: { size: 30} },
{ name: 'ProductDesription', index: 'ProductDesription', width: 40, editable: true, editoptions: { size: 30} },
{ name: 'FullPrice', index: 'FullPrice', width: 40 },
{ name: 'ActualPrice', index: 'ActualPrice', width: 40 },
{ name: 'IsPackage', index: 'IsPackage', width: 40, editable: true, editoptions: { size: 30, value: "Yes:No" }, edittype: "checkbox" },
{ name: 'IsActive', index: 'IsActive', width: 40, editable: true, editoptions: { size: 30, value: "Yes:No" }, edittype: "checkbox" },
{ name: 'IsShipment', index: 'IsShipment', width: 40, editable: true, editoptions: { size: 30, value: "Yes:No" }, edittype: "checkbox" },
{ name: 'IsPackageOnly', index: 'IsPackageOnly', width: 40, editable: true, editoptions: { size: 30, value: "Yes:No" }, edittype: "checkbox" },
{ name: '', index: '', width: 40 }, //attributes
{name: 'ProductInSites', index: 'ProductInSites', width: 40, editable: true, edittype: "textarea", editoptions: { rows: "2", cols: "35"} },
{ name: ' ', index: '', width: 40, align: 'center', editable: true, edittype: "textarea", editoptions: { rows: "2", cols: "35"} }, //callcentre
{ name: ' ', index: '', width: 40, align: 'center', formatter: updatebutton }, //button
],
rowNum: 20,
rowList: [10, 20, 30],
pager: '#jqpager',
sortname: 'OrderDate',
viewrecords: true,
sortorder: "desc",
caption: "Shipment Report",
autowidth: true,
height: "100%",
loadtext: "Loading...",
editurl: "ProductsList.ashx?actiontype=3"
});
答案 0 :(得分:0)
您在name: ''
中某些列的定义中使用了name: ' '
和colModel
。这是错误的。 name
属性必须是唯一的名称,没有空格或special characters。