From 82bdea09ae21f6c4ac7bf40aab99bd6b65c710ae Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 23 Oct 2018 13:50:31 +0200 Subject: [PATCH] added dataUpdate event --- client/core/src/components/model-proxy/model-proxy.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/core/src/components/model-proxy/model-proxy.js b/client/core/src/components/model-proxy/model-proxy.js index b22a69d87..ccdb3ce6a 100644 --- a/client/core/src/components/model-proxy/model-proxy.js +++ b/client/core/src/components/model-proxy/model-proxy.js @@ -44,6 +44,10 @@ ngModule.component('vnDataModel', { * made in model rows. * * @event dataChange Emitted when data property changes + * @event dataUpdate Emitted when data property changes + * @event rowInsert Emitted when new row is inserted + * @event rowRemove Emitted when row is removed + * @event rowChange Emitted when row property is changed */ export default class ModelProxy extends DataModel { constructor($element, $scope) { @@ -83,6 +87,7 @@ export default class ModelProxy extends DataModel { set data(value) { this._data = value; this.emit('dataChange'); + this.emit('dataUpdate'); } /** @@ -101,6 +106,7 @@ export default class ModelProxy extends DataModel { this.isChanged = true; this.emit('rowRemove', index); + this.emit('dataUpdate'); } /** @@ -120,6 +126,7 @@ export default class ModelProxy extends DataModel { this.isChanged = true; this.emit('rowInsert', index); + this.emit('dataUpdate'); return index; } @@ -139,6 +146,7 @@ export default class ModelProxy extends DataModel { obj.$oldData[prop] = value; this.isChanged = true; this.emit('rowChange', {obj, prop, value}); + this.emit('dataUpdate'); } return Reflect.set(obj, prop, value); }