提交 de93be2d 编写于 作者: U unknown

流程表单组件添加isEmpty方法

上级 03e98861
......@@ -217,7 +217,8 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({
return {"value": [value || ""] , "text": [text || value || ""]};
},
isEmpty : function(){
return !!this.getData();
var data = this.getData();
return !data || !data.trim();
},
getData: function(when){
if (this.json.compute == "save") this._setValue(this._computeValue());
......
......@@ -1107,9 +1107,9 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
isEmpty : function(){
var data = this.getData();
if( typeOf(data) === "array" ){
return data.length !== 0
return data.length == 0
}else{
return !!data;
return !data;
}
},
getData: function () {
......
......@@ -182,9 +182,9 @@ MWF.xApplication.process.Xform.Combox = MWF.APPCombox = new Class({
isEmpty : function(){
var data = this.getData();
if( typeOf(data) === "array" ){
return data.length !== 0;
return data.length === 0;
}else{
return !!data;
return !data;
}
},
getInputData: function(){
......
......@@ -1799,7 +1799,7 @@ debugger;
isEmpty: function(){
var data = this.getData();
if( typeOf(data) !== "object" )return true;
return !!data.filetext;
return !data.filetext || data.filetext===this.json.defaultValue.filetext;
},
getData: function(){
//if (this.editMode){
......
......@@ -373,7 +373,7 @@ MWF.xApplication.process.Xform.Htmleditor = MWF.APPHtmleditor = new Class({
this.setData(this._getBusinessData());
},
isEmpty : function(){
return !!this.getData();
return !this.getData().trim();
},
getData: function(){
this.clearEcnetNodes();
......
......@@ -87,7 +87,7 @@ MWF.xApplication.process.Xform.ImageClipper = MWF.APPImageClipper = new Class({
return {"value": [value], "text": [value]};
},
isEmpty : function(){
return !!this.getData();
return !this.getData();
},
getData: function( data ){
return this._getBusinessData() || "";
......
......@@ -3,7 +3,9 @@ MWF.xApplication.process.Xform.Number = MWF.APPNumber = new Class({
Implements: [Events],
Extends: MWF.APPTextfield,
iconStyle: "numberIcon",
isEmpty : function(){
return !this.getData();
},
getInputData: function(){
if (this.node.getFirst()){
var v = this.node.getElement("input").get("value");
......
......@@ -1205,7 +1205,7 @@ MWF.xApplication.process.Xform.Office = MWF.APPOffice = new Class({
},
isEmpty : function(){
var data = this.getData();
return !!data;
return !data.trim();
},
getData: function(){
if (this.officeOCX && (this.officeOCX.DocType==1 || this.officeOCX.DocType==6)){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册