|
|
@ -211,7 +211,7 @@ DataSet.prototype.add = function (data, senderId) { |
|
|
|
addedIds.push(id); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (data instanceof Object) { |
|
|
|
else if (data && typeof data === 'object') { |
|
|
|
// Single item
|
|
|
|
id = me._addItem(data); |
|
|
|
addedIds.push(id); |
|
|
@ -261,14 +261,14 @@ DataSet.prototype.update = function (data, senderId) { |
|
|
|
if (Array.isArray(data)) { |
|
|
|
// Array
|
|
|
|
for (var i = 0, len = data.length; i < len; i++) { |
|
|
|
if (data[i] instanceof Object){ |
|
|
|
if (data[i] && typeof data[i] === 'object'){ |
|
|
|
addOrUpdate(data[i]); |
|
|
|
} else { |
|
|
|
console.warn('Ignoring input item, which is not an object at index ' + i); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (data instanceof Object) { |
|
|
|
else if (data && typeof data === 'object') { |
|
|
|
// Single item
|
|
|
|
addOrUpdate(data); |
|
|
|
} |
|
|
@ -707,7 +707,7 @@ DataSet.prototype._remove = function (id) { |
|
|
|
if (util.isNumber(id) || util.isString(id)) { |
|
|
|
ident = id; |
|
|
|
} |
|
|
|
else if (id instanceof Object) { |
|
|
|
else if (id && typeof id === 'object') { |
|
|
|
ident = id[this._fieldId]; // look for the identifier field using _fieldId
|
|
|
|
} |
|
|
|
|
|
|
|