unknown 5 лет назад
Родитель
Сommit
6134884f57

+ 8 - 4
o2web/source/x_component_process_Xform/DatagridMobile.js

@@ -555,10 +555,13 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
             this.close();
         }, null, null, this.form.json.confirmStyle);
     },
-    _completeLineEdit: function(){
-        if (!this.editValidation()){
-            return false;
+    _completeLineEdit: function( ev, ignoreValidation ){
+	    if( !ignoreValidation ){
+            if (!this.editValidation()){
+                return false;
+            }
         }
+
         this.isEdit = false;
         //var flag = true;
 
@@ -1082,6 +1085,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
         this.setData(this._getValue());
     },
     setData: function(data){
+        // if( typeOf( data ) === "object" && typeOf(data.data) === "array"  ){
         if (data){
             this._setBusinessData(data);
             this.gridData = data;
@@ -1089,7 +1093,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
             this.gridData = this._getValue();
         }
 
-        if (this.isEdit) this._completeLineEdit();
+        if (this.isEdit) this._completeLineEdit( null,true );
         if (this.gridData){
 
             var tables = this.node.getElements("table");

+ 9 - 6
o2web/source/x_component_process_Xform/DatagridPC.js

@@ -405,11 +405,13 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 		}, null, null, this.form.json.confirmStyle);
 
 	},
-	_completeLineEdit: function(){
+	_completeLineEdit: function( ev, ignoreValidation ){
 		//this.currentEditLine.getElemets(td);
-        if (!this.editValidation()){
-            return false;
-        }
+		if( !ignoreValidation ){
+			if (!this.editValidation()){
+				return false;
+			}
+		}
 
 		this.isEdit = false;
 		
@@ -938,14 +940,15 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
         this.setData(this._getValue());
     },
     setData: function(data){
-        if (data){
+		// if( typeOf( data ) === "object" && typeOf(data.data) === "array"  ){
+		if (data){
             this._setBusinessData(data);
             this.gridData = data;
         }else{
             this.gridData = this._getValue();
         }
 
-        if (this.isEdit) this._completeLineEdit();
+        if (this.isEdit) this._completeLineEdit(  null,true );
         if (this.gridData){
             var trs = this.table.getElements("tr");
             for (var i=1; i<trs.length-1; i++){