← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21846: Added missing js function for validation rules

 

------------------------------------------------------------
revno: 21846
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2016-02-01 18:58:46 +0100
message:
  Added missing js function for validation rules
modified:
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/expressionBuilder.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-validationrule/src/main/webapp/dhis-web-validationrule/javascript/expressionBuilder.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/expressionBuilder.js	2015-09-08 15:56:00 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/expressionBuilder.js	2016-02-01 17:58:46 +0000
@@ -96,10 +96,10 @@
 			},
 			success: function( json, status, xhr ) {
 				if ( 'OK' == json.status ) {
-					jQuery( "#formulaText").html( json.description );
+					jQuery( "#formulaText" ).html( json.description );
 				}
 				else {
-					jQuery( "#formulaText").html( json.message );
+					jQuery( "#formulaText" ).html( json.message );
 				}
 			}
 		});
@@ -155,3 +155,19 @@
 		}
 	});
 }
+
+function clearRuleExpression()
+{
+    var description = $( "#leftSideDescription" ).val();
+    $( "#leftSideExpression" ).val( "" );
+    $( "#leftSideTextualExpression" ).val( "" );
+    saveExpression( "left", description, "", "" );
+
+    description = $( "#rightSideDescription" ).val();
+    $( "#rightSideExpression" ).val( "" );
+    $( "#rightSideTextualExpression" ).val( "" );
+    saveExpression( "right", description, "", "" );
+
+	enable( "ruleType" );
+	enable( "periodTypeName" );
+}