Fixes in value revert logic

This commit is contained in:
2018-08-11 19:30:55 +02:00
parent 2cadbdcd31
commit 9ec5a151cc
2 changed files with 22 additions and 7 deletions
+11 -3
View File
@@ -290,9 +290,17 @@ Rows are identified by row._id, columns by col.id
let wasDirty = this.isRowChanged(row, true)
let changes = []
_.each(row._orig, (v, k) => {
if (row[k] != v) {
changes.push(k)
_.each(this.columns, (col) => {
let val = row[col.id];
let orig = row._orig[col.id];
if (_.isUndefined(orig)) {
// null in DB
if (val !== '' && val !== 0) {
changes.push(col.id)
console.log('is dirty', JSON.stringify(val))
}
} else if (val != orig) {
changes.push(col.id)
}
})