diff --git a/lib/DataSet.js b/lib/DataSet.js index 1ffadc93..25ede879 100644 --- a/lib/DataSet.js +++ b/lib/DataSet.js @@ -274,7 +274,15 @@ DataSet.prototype.update = function (data, senderId) { this._trigger('add', {items: addedIds}, senderId); } if (updatedIds.length) { - this._trigger('update', {items: updatedIds, data: updatedData}, senderId); + var props = { items: updatedIds, oldData: updatedData }; + // TODO: remove deprecated property 'data' some day + Object.defineProperty(props, 'data', { + 'get': (function() { + console.warn('Property data is deprecated. Use DataSet.get(ids) to retrieve the new data, use the oldData property on this object to get the old data'); + return this.get(updatedIds); + }).bind(this) + }); + this._trigger('update', props, senderId); } return addedIds.concat(updatedIds);