diff --git a/client/core/src/components/crud-model/crud-model.js b/client/core/src/components/crud-model/crud-model.js index 251dbcfc4..9682416b5 100644 --- a/client/core/src/components/crud-model/crud-model.js +++ b/client/core/src/components/crud-model/crud-model.js @@ -144,7 +144,7 @@ export default class CrudModel extends ModelProxy { for (let row of this.removed) remove.push(row.$orgRow[pk]); - for (let row of this._data) { + for (let row of this._data) if (row.$isNew) { let data = {}; for (let prop in row) @@ -160,7 +160,6 @@ export default class CrudModel extends ModelProxy { where: {[pk]: row.$orgRow[pk]} }); } - } let changes = { create: create, @@ -184,7 +183,10 @@ export default class CrudModel extends ModelProxy { let url = this.saveUrl ? this.saveUrl : `${this._url}/crud`; return this.$http.post(url, changes) - .then(() => this.applyChanges()); + .then(() => { + this.applyChanges(); + super.save(); + }); } buildParams() { @@ -220,9 +222,9 @@ export default class CrudModel extends ModelProxy { onRemoteDone(json, filter, append) { let data = json.data; - if (append) { + if (append) this.orgData = this.orgData.concat(data); - } else { + else { this.orgData = data; this.currentFilter = filter; } @@ -267,6 +269,7 @@ ngModule.component('vnCrudModel', { userFilter: '