← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3915: Add a "Clear" button next to the "Filter" button for indicator and validation rule.

 

------------------------------------------------------------
revno: 3915
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-06-16 08:47:10 +0700
message:
  Add a "Clear" button next to the "Filter" button for indicator and validation rule.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorExpressionBuilderForm.vm
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/expressionBuilderForm.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-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorExpressionBuilderForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorExpressionBuilderForm.vm	2011-05-20 16:00:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorExpressionBuilderForm.vm	2011-06-16 01:47:10 +0000
@@ -67,6 +67,12 @@
 		dataDictionary.loadOperands( "#indicator-expression-container select[id=dataElementId]", {aggregationOperator: aggregationOperator, usePaging: true, key: key, includeTotals: true} );
 
 		checkAggregationOperator();
+	}
+
+	function clearSearchText()
+	{
+		jQuery( "#indicator-expression-container input[id=filter]").val("");
+		getOperandsPage();
 	}	
 	
 	function getExpressionText()
@@ -191,8 +197,9 @@
 		<td></td>
 		<td valign="top">
 			<label>$encoder.htmlEncode( $i18n.getString( "filter_by_name" ) )</label><br/>
-			<input type="text" id="filter" name="filter" style="width:400px">
-			<input type="button" value="$i18n.getString( 'filter' )" onclick="getOperandsPage()" style="width:60px"><br/>
+			<input type="text" id="filter" name="filter" style="width:370px">
+			<input type="button" value="$i18n.getString( 'filter' )" onclick="getOperandsPage()" style="width:60px">
+			<input type="button" value="$i18n.getString( 'clear' )" onclick="clearSearchText();" style="width:60px"><br/>
 
 			<select id="dataElementId" name="dataElementId" size="7" style="width:510px" ondblclick="insertText( 'expression', this.value )">
 			</select>

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/expressionBuilderForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/expressionBuilderForm.vm	2011-05-20 16:00:10 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/expressionBuilderForm.vm	2011-06-16 01:47:10 +0000
@@ -57,6 +57,12 @@
 		dataDictionary.loadOperands( "#expression-container select[id=dataElementId]", {usePaging: true, key: key, periodType: periodType} );	
 	}
 	
+	function clearSearchText()
+	{
+		jQuery( "#expression-container input[id=filter]").val("");
+		getOperandsPage();
+	}
+	
 	function getExpressionText()
 	{
 		if( hasText('expression') ){
@@ -153,8 +159,9 @@
 		<td></td>
 		<td valign="top">
 			<label>$encoder.htmlEncode( $i18n.getString( "filter_by_name" ) )</label><br/>
-			<input type="text" id="filter" name="filter" style="width:380px">
-			<input type="button" value="$i18n.getString( 'filter' )" onclick="getOperandsPage()" style="width:60px"><br/>
+			<input type="text" id="filter" name="filter" style="width:320px">
+			<input type="button" value="$i18n.getString( 'filter' )" onclick="getOperandsPage()" style="width:60px">
+			<input type="button" value="$i18n.getString( 'clear' )" onclick="clearSearchText();" style="width:60px"><br/>
 
 			<select id="dataElementId" name="dataElementId" size="7" style="min-width:450px" ondblclick="insertText( 'expression', this.value )">
 			</select>