|
@ -300,6 +300,7 @@ DataView.prototype._onEvent = function (event, params, senderId) { |
|
|
var ids = params && params.items; |
|
|
var ids = params && params.items; |
|
|
var data = this._data; |
|
|
var data = this._data; |
|
|
var updatedData = []; |
|
|
var updatedData = []; |
|
|
|
|
|
var oldData = []; |
|
|
var added = []; |
|
|
var added = []; |
|
|
var updated = []; |
|
|
var updated = []; |
|
|
var removed = []; |
|
|
var removed = []; |
|
@ -330,6 +331,7 @@ DataView.prototype._onEvent = function (event, params, senderId) { |
|
|
if (this._ids[id]) { |
|
|
if (this._ids[id]) { |
|
|
updated.push(id); |
|
|
updated.push(id); |
|
|
updatedData.push(params.data[i]); |
|
|
updatedData.push(params.data[i]); |
|
|
|
|
|
oldData.push(params.oldData[i]); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
this._ids[id] = true; |
|
|
this._ids[id] = true; |
|
@ -368,7 +370,7 @@ DataView.prototype._onEvent = function (event, params, senderId) { |
|
|
this._trigger('add', {items: added}, senderId); |
|
|
this._trigger('add', {items: added}, senderId); |
|
|
} |
|
|
} |
|
|
if (updated.length) { |
|
|
if (updated.length) { |
|
|
this._trigger('update', {items: updated, data: updatedData}, senderId); |
|
|
|
|
|
|
|
|
this._trigger('update', {items: updated, oldData: oldData, data: updatedData}, senderId); |
|
|
} |
|
|
} |
|
|
if (removed.length) { |
|
|
if (removed.length) { |
|
|
this._trigger('remove', {items: removed}, senderId); |
|
|
this._trigger('remove', {items: removed}, senderId); |
|
|