Răsfoiți Sursa

表单组件增加isEmpty

unknown 5 ani în urmă
părinte
comite
f5b63a88fe

+ 6 - 0
o2web/source/x_component_process_Xform/Checkbox.js

@@ -180,6 +180,12 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox =  new Class({
 		//}
 		//return (value.length==1) ? value[0] : value;
     //},
+    isEmpty: function(){
+        var data = this.getData();
+        if( typeOf(data) !== "array" )return true;
+        if( data.length === 0 )return true;
+        return false;
+    },
     getInputData: function(){
         if (this.readonly || this.json.isReadonly ){
             return this._getBusinessData();

+ 3 - 0
o2web/source/x_component_process_Xform/Htmleditor.js

@@ -372,6 +372,9 @@ MWF.xApplication.process.Xform.Htmleditor = MWF.APPHtmleditor =  new Class({
     resetData: function(){
         this.setData(this._getBusinessData());
     },
+    isEmpty : function(){
+        return !!this.getData();
+    },
     getData: function(){
         this.clearEcnetNodes();
         return this.editor.getData();

+ 3 - 0
o2web/source/x_component_process_Xform/ImageClipper.js

@@ -86,6 +86,9 @@ MWF.xApplication.process.Xform.ImageClipper = MWF.APPImageClipper =  new Class({
         var value = this._getBusinessData() || "";
         return {"value": [value], "text": [value]};
     },
+    isEmpty : function(){
+        return !!this.getData();
+    },
     getData: function( data ){
         return this._getBusinessData() || "";
     },