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