@ -236,6 +236,7 @@ DataSet.prototype.add = function (data, senderId) {
DataSet.prototype.update=function(data,senderId){
varaddedIds=[];
varupdatedIds=[];
varoldData=[];
varupdatedData=[];
varme=this;
varfieldId=me._fieldId;
@ -243,11 +244,12 @@ DataSet.prototype.update = function (data, senderId) {
varaddOrUpdate=function(item){
varid=item[fieldId];
if(me._data[id]){
varoldData=util.extend({},me._data[id]);
varoldItem=util.extend({},me._data[id]);
// update item
id=me._updateItem(item);
updatedIds.push(id);
updatedData.push(oldData);
updatedData.push(item);
oldData.push(oldItem);
}
else{
// add new item
@ -274,14 +276,14 @@ DataSet.prototype.update = function (data, senderId) {
this._trigger('add',{items:addedIds},senderId);
}
if(updatedIds.length){
varprops={items:updatedIds,oldData:updatedData};
// TODO: remove deprecated property 'data' some day
Object.defineProperty(props,'data',{
'get':(function(){
console.warn('Property data is deprecated. Use DataSet.get(ids) to retrieve the new data, use the oldData property on this object to get the old data');
// TODO: remove deprecated property 'data' some day
//Object.defineProperty(props, 'data', {
// 'get': (function() {
// console.warn('Property data is deprecated. Use DataSet.get(ids) to retrieve the new data, use the oldData property on this object to get the old data');