diff --git a/lib/DataSet.js b/lib/DataSet.js index b87ddcd7..1ffadc93 100644 --- a/lib/DataSet.js +++ b/lib/DataSet.js @@ -243,10 +243,11 @@ DataSet.prototype.update = function (data, senderId) { var addOrUpdate = function (item) { var id = item[fieldId]; if (me._data[id]) { + var oldData = util.extend({}, me._data[id]); // update item id = me._updateItem(item); updatedIds.push(id); - updatedData.push(item); + updatedData.push(oldData); } else { // add new item @@ -513,7 +514,7 @@ DataSet.prototype.forEach = function (callback, options) { var filter = options && options.filter, type = options && options.type || this._options.type, data = this._data, - itemIds = Object.key(data), + itemIds = Object.keys(data), i, len, item,