I need to restore(set value to before edited value) edited grid cell value in edit function, not in validateedit function.
"orderList": {
validateedit: function (plugin, edit) {
//validate...
},
edit: function (plugin, edit) {
Ext.MessageBox.confirm('Confirm', 'Are you sure to change this order status?', function (btn) {
if (btn == 'yes') {
//update
} else {
// I want to rollback!
edit.cancel = true;
edit.record.data[edit.field] = edit.originalValue; //it does not work
}
});
}
}
How to change the grid cell value (editor)?
Thanks!
How about the reject method:
Also note that the second argument (the one you named “edit”) of the
editevent does not contain acancelproperty, that is a property of thebeforeeditevent. So this lineedit.cancel = truewon’t do anything for you.I was also curious why you aren’t using the
beforeeditevent, it seems more ideally suited for this kind of thing – that it why it does have thatcancelproperty.