【发布时间】:2016-02-03 20:10:43
【问题描述】:
我有一个 jqGrid,我想在其中检查单元格数据并仅发布数据已更改的列。
认为这是我的colModel
colModel: [{
name: 'I_PK',
index: 'u.I_PK',
align: 'right',
editable: false,
sopt: ['cn', 'eq', 'ne', 'lt', 'le', 'gt', 'ge', 'bw', 'ew', 'nc']
}, {
name: 'W3LabelSelected',
index: 'u.W3LabelSelected',
align: 'center',
width: 170,
editable: false,
edittype: 'checkbox',
formatter: "checkbox",
search: false,
formatoptions: {
disabled: false
},
editoptions: {
value: "1:0"
}
}, {
name: 'I_ItemNumID',
index: 'u.I_ItemNumID',
align: 'right',
editable: true,
editoptions: {
dataEvents: [{
type: 'focusin',
fn: function (e) {
var elem = e.target;
setTimeout(function () {
elem.select();
}, 50);
}
}]
}
}, {
name: 'Quantity',
index: 'u.Quantity',
align: 'right',
editable: true,
editoptions: {
dataEvents: [{
type: 'focusin',
fn: function (e) {
var elem = e.target;
setTimeout(function () {
elem.select();
}, 50);
}
}]
}
}],
在这个网格中,我的两列是可编辑的。现在假设我在内联编辑中对任何行的其中一列进行了更改,那么应该只发布该单元格的值。当前功能发布该特定行的所有单元格。这可能吗?
我发现了一些关于此的问题 here 和 there,但似乎都没有解决这个特定问题。
基本上我能想到的想法是,在保存之前,如果我可以在发布之前以某种方式将该行的所有可编辑单元格的原始数据与新值进行比较,我可以消除数据没有的单元格已更改,仅发布已更改的单元格。
【问题讨论】:
标签: javascript jquery jqgrid free-jqgrid