|
@ -453,6 +453,7 @@ LineGraph.prototype._updateAllGroupData = function (ids, groupIds) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//Pre-load arrays from existing groups if items are not changed (not in ids)
|
|
|
//Pre-load arrays from existing groups if items are not changed (not in ids)
|
|
|
|
|
|
var existingItemsMap = {}; |
|
|
if (!groupIds && ids) { |
|
|
if (!groupIds && ids) { |
|
|
for (var groupId in this.groups) { |
|
|
for (var groupId in this.groups) { |
|
|
if (this.groups.hasOwnProperty(groupId)) { |
|
|
if (this.groups.hasOwnProperty(groupId)) { |
|
@ -460,6 +461,7 @@ LineGraph.prototype._updateAllGroupData = function (ids, groupIds) { |
|
|
var existing_items = group.getItems(); |
|
|
var existing_items = group.getItems(); |
|
|
|
|
|
|
|
|
groupsContent[groupId] = existing_items.filter(function (item) { |
|
|
groupsContent[groupId] = existing_items.filter(function (item) { |
|
|
|
|
|
existingItemsMap[item[fieldId]] = item[fieldId]; |
|
|
return (item[fieldId] !== idMap[item[fieldId]]); |
|
|
return (item[fieldId] !== idMap[item[fieldId]]); |
|
|
}); |
|
|
}); |
|
|
var newLength = groupCounts[groupId]; |
|
|
var newLength = groupCounts[groupId]; |
|
@ -478,7 +480,7 @@ LineGraph.prototype._updateAllGroupData = function (ids, groupIds) { |
|
|
if (groupId === null || groupId === undefined) { |
|
|
if (groupId === null || groupId === undefined) { |
|
|
groupId = UNGROUPED; |
|
|
groupId = UNGROUPED; |
|
|
} |
|
|
} |
|
|
if (!groupIds && ids && (item[fieldId] !== idMap[item[fieldId]])) { |
|
|
|
|
|
|
|
|
if (!groupIds && ids && (item[fieldId] !== idMap[item[fieldId]]) && existingItemsMap.hasOwnProperty(item[fieldId])) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
if (!groupsContent.hasOwnProperty(groupId)) { |
|
|
if (!groupsContent.hasOwnProperty(groupId)) { |
|
|