I have a jqGrid where I would like to check for cell data and only post the columns of which the data has changed.
Consider this is my 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);
}
}]
}
}],
In this grid, two of my columns are editable. Now let's say if I make changes in one of the columns of any row in inline editing, then only that cell's value should be posted. Current functionality posts all the cells of that specific row. Is this possible?
I found some questions here and there about this but none seem to be addressing this specific problem.
Basically the idea I can think of is that before saving, if I can somehow compare the original data of all the editable cells of that row to the new value before getting posted, I can eliminate the cells of which the data has not changed and only post the cell which has changed.
Sample grid: http://jsfiddle.net/dipenshah8/HJema/203/