added dataUpdate event
This commit is contained in:
parent
e98e8cdb37
commit
82bdea09ae
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue