我正在尝试验证ui网格中可编辑单元格的值,例如确保填写密码值。我正在使用事件afterCellEdit
将密码值设置为旧值,以防它为空:
rowEntity.password = oldValue;
但是,我不确定这是最好的方法,但更重要的是,在这之后行变脏了,我希望它保持干净,所以我不会保存它。
答案 0 :(得分:0)
这对我有用....试试吧..
gridApi.edit.on.afterCellEdit($scope, function (rowEntity, colDef, newValue, oldValue) {
//Setting old value here
rowEntity[colDef.field] = oldValue;
});