← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14898: Just support Unique for value type, includes Number, String and Letter Only in Add/Update attribu...

 

------------------------------------------------------------
revno: 14898
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-04-18 18:22:11 +0800
message:
  Just support Unique for value type, includes Number, String and Letter Only in Add/Update attribute form.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/attribute.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-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/attribute.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/attribute.js	2014-04-18 08:58:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/attribute.js	2014-04-18 10:22:11 +0000
@@ -77,7 +77,8 @@
 
 
 function typeOnChange() {
-	if( getFieldValue('valueType')=="combo"){
+	var type = getFieldValue('valueType');
+	if( type=="combo"){
 		showById("optionSetRow");
 		enable("optionSetId");
 	}
@@ -85,6 +86,13 @@
 		hideById("optionSetRow");
 		disable("optionSetId");
 	}
+	
+	if( type=="number" || type=='string' || type=='letter' ){
+		enable("unique");
+	}
+	else{
+		disable("unique");
+	}
 }
 
 function uniqueOnChange(){