我使用的是 JQgrid,并且使用内联编辑一切正常,但我需要禁用 Enter 按键。表示如果用户输入值并单击输入,则不需要执行任何操作。现在它试图根据编辑 url 存储数据。但我不需要这个功能。
只需禁用 JQGrid 上的输入键。任何人都可以帮忙吗?
嗨奥列格你问我粘贴我的代码有点长,所以我发布了需要的部分。
$("#RevenueReporttbl").jqGrid({
contentType: "application/json; charset=utf-8",
mtype: 'GET',
// url: '/AMForecast/Index/',
height: 'auto',
// width: 'auto',
width: '1150',
gridview: true,
datatype: "local",
loadonce: true,
data: search_result,
colNames: ['ForecastId', 'CustomerId', 'Customer Name', 'UserId', 'Person', 'ProjectId', 'Project Name', 'Edit', 'Ytd'],
colModel: [
{ name: 'ForecastId', index: 'ForecastId', editable: false, sortable: false, hidden: true, fixed: true },
{ name: 'CustomerId', index: 'CustomerId', editable: false, sortable: false, hidden: true, fixed: true },
{ name: 'CustomerName', index: 'CustomerName', width: 130, editable: false, sortable: false, fixed: true },
{ name: 'UserId', index: 'UserId', width: 130, editable: false, sortable: false, hidden: true, fixed: true },
{ name: 'Manager', index: 'Manager', align: 'left', width: 130, editable: false, sortable: false, fixed: true },
{ name: 'ProjectId', index: 'ProjectId', editable: false, sortable: false, hidden: true, fixed: true },
{ name: 'ProjectName', index: 'ProjectName', editable: false, sortable: false, hidden: true, fixed: true },
{ name: 'Edit', index: 'Edit', editable: false, width: 40, align: 'center', hidden: false, sortable: false, fixed: true },
{ name: 'Ytd', index: 'Ytd', editable: false, width: 40, align: 'right', sortable: false, summaryType: 'sum', fixed: true }],
rowNum: 99,
pager: '#pager',
footerrow: true,
userDataOnFooter: true,
altRows: false,
rowList: [100, 200, 300, 400, 500],
multipleSearch: true,
//multiselect: true,
multipleGroup: true,
shrinkToFit: true,
viewrecords: true,
sortorder: "desc",
subGrid: true,
grouping: true, //changed
groupingView: {
groupField: ['CustomerType'],
groupSummary: [true],
groupColumnShow: [false],
groupText: ['<b>{0}</b>'],
groupCollapse: false,
groupOrder: ['asc'],
groupDataSorted: true
},
jsonReader: {
root: "gridModel",
page: "page",
total: "total",
records: "records",
repeatitems: false,
cell: "cell",
id: "id",
subgrid: {
root: "gridModel",
repeatitems: true,
cell: "cell",
id: "id"
}
}
所以我也使用带有只读选项的子网格。请告诉如何使输入键为假?当我在编辑模式下单击输入时,我不想做任何事情。