← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7275: Error when to save data values in Tabular report.

 

------------------------------------------------------------
revno: 7275
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-06-12 12:26:49 +0700
message:
  Error when to save data values in Tabular report.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportResult.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2012-06-12 04:08:11 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2012-06-12 05:26:49 +0000
@@ -1400,7 +1400,11 @@
 						grid.getView().getNode(e.rowIdx).classList.remove('hidden');
 						
 						var oldValue = e.originalValue;
-						var newValue = editor.editors.items[0].field.rawValue;
+						var newValue = e.value;
+						if( newValue == oldValue)
+						{
+							return false;
+						}
 						var psiId = TR.store.datatable.getAt(e.rowIdx).data['id'];
 						var deId = e.column.name.split('_')[1];
 						TR.value.save( psiId, deId, newValue);
@@ -1413,19 +1417,12 @@
 					},
 					validateedit: function( editor, e, eOpts )
 					{
-						var newValue = editor.editors.items[0].field.rawValue;
+						var newValue = editor.editors.items[editor.editors.items.length-1].field.rawValue;
 						if( e.column.compulsory && newValue =='' )
 						{
 							TR.util.notification.error( TR.i18n.not_empty, TR.i18n.not_empty );
 							return false;
 						}
-						
-						var oldValue = e.originalValue;
-						if( newValue == oldValue)
-						{
-							return false;
-						}
-						
 						return true;
 					}
 				}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportResult.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportResult.vm	2012-06-12 04:08:11 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportResult.vm	2012-06-12 05:26:49 +0000
@@ -32,8 +32,7 @@
   #foreach( $row in $grid.getRows() )
   [
     #foreach( $col in $row )
-	#set($colName = "col"+ $velocityCount)
-    "$!col"#if( $velocityCount < $noHeader ),#end
+	"$!col"#if( $velocityCount < $noHeader ),#end
     #end
   ]#if( $velocityCount < $noRows ),#end
   #end