瀏覽代碼

修复数据网格只读状态下附件显示错误的问题

unknown 5 年之前
父節點
當前提交
3b3ed3a7d0

+ 6 - 2
o2web/source/x_component_process_Xform/DatagridMobile.js

@@ -226,6 +226,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
     __loadReadDatagrid: function(callback){
     __loadReadDatagrid: function(callback){
         //this.gridData = this._getValue();
         //this.gridData = this._getValue();
 
 
+
         var titleHeaders = this.table.getElements("th");
         var titleHeaders = this.table.getElements("th");
         var tds = this.table.getElements("td");
         var tds = this.table.getElements("td");
 
 
@@ -521,6 +522,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
             "toolbarGroupHidden": module.json.dg_toolbarGroupHidden || []
             "toolbarGroupHidden": module.json.dg_toolbarGroupHidden || []
         };
         };
         if (this.readonly) options.readonly = true;
         if (this.readonly) options.readonly = true;
+        if(!this.editable && !this.addable)options.readonly = true;
 
 
         var atts = [];
         var atts = [];
         data.each(function(d){
         data.each(function(d){
@@ -532,7 +534,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
         module.setAttachmentBusinessData();
         module.setAttachmentBusinessData();
 
 
 
 
-        var attachmentController = new MWF.xApplication.process.Xform.AttachmentController(cell, this, options);
+        var attachmentController = new MWF.xApplication.process.Xform.AttachmentController(cell, module, options);
         attachmentController.load();
         attachmentController.load();
 
 
         data.each(function (att) {
         data.each(function (att) {
@@ -835,7 +837,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
                 }
                 }
 
 
                 var cell;
                 var cell;
-                var text = this._getValueText(idx, data.text.join(", "));
+                // var text = this._getValueText(idx, data.text.join(", "));
 
 
                 if (dataRow){
                 if (dataRow){
                     cell = dataRow.getElement("td");
                     cell = dataRow.getElement("td");
@@ -844,6 +846,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
                     }else if( module.json.type == "Attachment" || module.json.type == "AttachmentDg" ){
                     }else if( module.json.type == "Attachment" || module.json.type == "AttachmentDg" ){
                         this._createAttachment( cell, module, data );
                         this._createAttachment( cell, module, data );
                     }else{
                     }else{
+                        var text = this._getValueText(idx, data.text.join(", "));
                         if( module && module.json.type == "Textarea" ){
                         if( module && module.json.type == "Textarea" ){
                             cell.set("html", text);
                             cell.set("html", text);
                         }else{
                         }else{
@@ -866,6 +869,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
                     }else if( module.json.type == "Attachment" || module.json.type == "AttachmentDg" ){
                     }else if( module.json.type == "Attachment" || module.json.type == "AttachmentDg" ){
                         this._createAttachment( cell, module, data );
                         this._createAttachment( cell, module, data );
                     }else{
                     }else{
+                        var text = this._getValueText(idx, data.text.join(", "));
                         if( module && module.json.type == "Textarea" ){
                         if( module && module.json.type == "Textarea" ){
                             cell.set("html", text);
                             cell.set("html", text);
                         }else{
                         }else{

+ 2 - 3
o2web/source/x_component_process_Xform/DatagridPC.js

@@ -610,7 +610,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 			"toolbarGroupHidden": module.json.dg_toolbarGroupHidden || []
 			"toolbarGroupHidden": module.json.dg_toolbarGroupHidden || []
 		};
 		};
 		if (this.readonly) options.readonly = true;
 		if (this.readonly) options.readonly = true;
-		if(!this.editable)options.readonly = true;
+		if(!this.editable && !this.addable)options.readonly = true;
 
 
 		var atts = [];
 		var atts = [];
 		data.each(function(d){
 		data.each(function(d){
@@ -622,7 +622,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 		module.setAttachmentBusinessData();
 		module.setAttachmentBusinessData();
 
 
 
 
-		var attachmentController = new MWF.xApplication.process.Xform.AttachmentController(cell, this, options);
+		var attachmentController = new MWF.xApplication.process.Xform.AttachmentController(cell, module, options);
 		attachmentController.load();
 		attachmentController.load();
 
 
 		data.each(function (att) {
 		data.each(function (att) {
@@ -884,7 +884,6 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 							if( module && module.json.type == "ImageClipper" ) {
 							if( module && module.json.type == "ImageClipper" ) {
 								this._createImage(cell, module, v);
 								this._createImage(cell, module, v);
 							}else if( module && (module.json.type == "Attachment" || module.json.type == "AttachmentDg") ){
 							}else if( module && (module.json.type == "Attachment" || module.json.type == "AttachmentDg") ){
-								debugger;
 								this._createAttachment( cell, module, v );
 								this._createAttachment( cell, module, v );
 							}else{
 							}else{
 								var text = this._getValueText(index, v);
 								var text = this._getValueText(index, v);