|
data.js
cancelUpdates : function(noFireEvent){
var data = this.data;
data.disableRecordChange();
try {// 特殊删除,解决关联计算触发问题
var row = this.row,b=false;
var recordState = row.userdata.recordState;
if (Data.STATE.EDIT == recordState) {
b=true;
for ( var k in data.defCols) {
var def = data.defCols[k];
//要判断是不是有计算规则,UI计算列
if (!data.isUICalculateCol(k) && !(def.calculate instanceof Expr)){
row[k].changed = 0;
row[k].value.set(row[k].originalValue);
}
}
}else if (Data.STATE.NEW == recordState) {
b=true;
data.remove(row);
}
if(b){
row.userdata.recordState = Data.STATE.NONE;
if(!noFireEvent){
var eventData = {};
eventData.source = data;
eventData.changedSource = data;
eventData.type = 'cancel';
eventData.selfChanged = true;
data.doDataChanged(eventData);
}
}
} finally {
data.enabledRecordChange();
}
},
中的代码段
if (!data.isUICalculateCol(k) && !(def.calculate instanceof Expr)){
row[k].changed = 0;
row[k].value.set(row[k].originalValue);
}
把编辑中的一行不管有没有改变,都还原了回去,造成没变换的字段被变成undefined
是不是有点问题
|
|