ソースを参照

修复流程表单复选框组件只读状态下保存清空值的问题

unknown 5 年 前
コミット
adcdb8c993
1 ファイル変更14 行追加10 行削除
  1. 14 10
      o2web/source/x_component_process_Xform/Checkbox.js

+ 14 - 10
o2web/source/x_component_process_Xform/Checkbox.js

@@ -181,17 +181,21 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox =  new Class({
 		//return (value.length==1) ? value[0] : value;
     //},
     getInputData: function(){
-        var inputs = this.node.getElements("input");
-        var value = [];
-        if (inputs.length){
-            inputs.each(function(input){
-                if (input.checked){
-                    var v = input.get("value");
-                    if (v) value.push(v || "");
-                }
-            });
+        if (this.readonly || this.json.isReadonly ){
+            return this._getBusinessData();
+        }else{
+            var inputs = this.node.getElements("input");
+            var value = [];
+            if (inputs.length){
+                inputs.each(function(input){
+                    if (input.checked){
+                        var v = input.get("value");
+                        if (v) value.push(v || "");
+                    }
+                });
+            }
+            return (value.length) ? value : [];
         }
-        return (value.length) ? value : [];
     },
     resetData: function(){
         this.setData(this.getValue());