提交 2d8ada74 编写于 作者: U unknown

数据网格单行编辑完成判断没有附件的时候不保存

上级 b718adad
......@@ -793,6 +793,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class(
}
this.isEdit = false;
var saveFlag = false;
//var flag = true;
var griddata = {};
......@@ -860,6 +861,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class(
}
data = {"value": [i], "text": [i]};
}else if( module.json.type=="Attachment" || module.json.type == "AttachmentDg" ) {
saveFlag = true;
var data = module.getTextData();
//data.site = module.json.site;
if (!griddata[id]) griddata[id] = {};
......@@ -958,7 +960,9 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class(
}.bind(this));
}
this.form.saveFormData();
if(saveFlag){
this.form.saveFormData();
}
return true;
},
_editorTrGoBack: function(){
......@@ -1068,6 +1072,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class(
});
},
_deleteLine: function(node, e){
var saveFlag = false;
var currentTable = node.getElement("table");
if (currentTable){
......@@ -1085,6 +1090,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class(
var key = th.get("id");
var module = _self.editModules[i];
if (key && module && (module.json.type=="Attachment" || module.json.type=="AttachmentDg")){
saveFlag = true;
data[key][module.json.id].each(function(d){
_self.form.workAction.deleteAttachment(d.id, _self.form.businessData.work.id);
});
......@@ -1107,7 +1113,10 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class(
this.close();
_self.fireEvent("afterDeleteLine");
_self.form.saveFormData();
if(saveFlag){
_self.form.saveFormData();
}
}, function(){
//var color = currentTr.retrieve("bgcolor");
......
......@@ -580,6 +580,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
this.isEdit = false;
var flag = true;
var saveFlag = false;
var griddata = {};
var newTr = null;
......@@ -605,6 +606,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
var i = newTr.rowIndex;
var data = {"value": [i], "text": [i]};
}else if (module.json.type=="Attachment" || module.json.type == "AttachmentDg"){
saveFlag = true;
flag = false;
var data = module.getTextData();
//data.site = module.json.site;
......@@ -679,7 +681,9 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
this.validationMode();
this.fireEvent("completeLineEdit", [newTr]);
this.form.saveFormData();
if( saveFlag ){
this.form.saveFormData();
}
return true;
},
......@@ -777,6 +781,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
// }.bind(this));
},
_deleteLine: function(e){
var saveFlag = false;
var currentTr = e.target.getParent("tr");
if (currentTr){
var color = currentTr.getStyle("background");
......@@ -798,6 +803,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
data[key][module.json.id].each(function(d){
_self.form.workAction.deleteAttachment(d.id, _self.form.businessData.work.id);
});
saveFlag = true;
}
});
......@@ -810,7 +816,9 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
_self.fireEvent("afterDeleteLine");
_self.form.saveFormData();
if(saveFlag){
_self.form.saveFormData();
}
}, function(){
var color = currentTr.retrieve("bgcolor");
currentTr.tween("background", color);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册