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