← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8904: Minor fix for tabular report.

 

------------------------------------------------------------
revno: 8904
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-11-06 20:35:48 +0700
message:
  Minor fix for tabular report.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js


--
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/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-10-31 09:05:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-11-06 13:35:48 +0000
@@ -159,6 +159,7 @@
 			<result name="error" type="velocity-json">
 				/dhis-web-commons/ajax/jsonResponseError.vm
 			</result>
+			<param name="onExceptionReturn">plainTextError</param>
 			<param name="requiredAuthorities">F_PROGRAM_STAGE_INSTANCE_DELETE</param>
 		</action>
 

=== 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-11-01 00:44:14 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2012-11-06 13:35:48 +0000
@@ -1125,14 +1125,22 @@
 				url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.datavalue_save,
 				method: 'POST',
 				params: params,
-				success: function() {
-					var rowIdx = e.rowIdx;
-					var colIdx = e.colIdx + 1;
-					if( e.colIdx == TR.datatable.datatable.columns.length - 2 ){
-						colIdx = 0;
-						rowIdx++;
-					}
-					TR.datatable.cellEditing.startEditByPosition({row: rowIdx, column: colIdx});
+				success: function(r) {
+					var json = Ext.JSON.decode(r.responseText);
+					if(json.response=="success")
+					{
+						var rowIdx = e.rowIdx;
+						var colIdx = e.colIdx + 1;
+						if( e.colIdx == TR.datatable.datatable.columns.length - 2 ){
+							colIdx = 0;
+							rowIdx++;
+						}
+						TR.datatable.cellEditing.startEditByPosition({row: rowIdx, column: colIdx});
+					}
+					else
+					{
+						TR.util.notification.error(TR.i18n.error, json.message);
+					}
 				}
 			});
 		},
@@ -1144,11 +1152,19 @@
 					var params = 'id=' + psiId; 
 					Ext.Ajax.request({
 						url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.datavalue_delete,
-						method: 'GET',
+						method: 'POST',
 						params: params,
-						success: function() {
-							var grid = TR.datatable.datatable;
-							grid.getView().getNode(rowIdx).classList.add('hidden');
+						success: function(r) {
+							var json = Ext.JSON.decode(r.responseText);
+							if(json.response=="success")
+							{
+								var grid = TR.datatable.datatable;
+								grid.getView().getNode(rowIdx).classList.add('hidden');
+							}
+							else
+							{
+								TR.util.notification.error(TR.i18n.error, json.message);
+							}
 						}
 					});
 				}