← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6684: Added method for getting selected org unit uid in oust

 

------------------------------------------------------------
revno: 6684
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2012-04-22 23:15:54 +0200
message:
  Added method for getting selected org unit uid in oust
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/responseSelect.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-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js	2012-03-02 11:49:40 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js	2012-04-22 21:15:54 +0000
@@ -8,6 +8,7 @@
 var selectionTree = new SelectionTree();
 var selectionTreePath = '../dhis-web-commons/oust/';
 var selectedOrganisationUnit = new Array();
+var selectedOrganisationUnitUid = new Array();
 
 // -----------------------------------------------------------------------------
 // Selection
@@ -41,6 +42,11 @@
 		return selectedOrganisationUnit;
 	};
 	
+	this.getSelectedUid = function()
+	{
+		return selectedOrganisationUnitUid;
+	}
+	
 	this.isSelected = function()
 	{
 		return selectedOrganisationUnit && selectedOrganisationUnit.length > 0;
@@ -94,13 +100,18 @@
     function responseReceived( json )
     {
 		selectedOrganisationUnit = new Array();
+		selectedOrganisationUnitUid = new Array();
 
 		var unitIds = new Array();
+		var unitUids = new Array();
 
         for ( i in json.selectedUnits )
         {
             unitIds[i] = json.selectedUnits[i].id;
 			selectedOrganisationUnit.push( unitIds[i] );
+			
+			unitUids[i] = json.selectedUnits[i].uid;
+			selectedOrganisationUnitUid.push( unitUids[i] );
         }
 
         jQuery("body").trigger("oust.selected", selectedOrganisationUnit);

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/responseSelect.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/responseSelect.vm	2011-07-22 09:17:04 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/responseSelect.vm	2012-04-22 21:15:54 +0000
@@ -3,7 +3,8 @@
 #foreach( $unit in $selectedUnits )
   {
 	"id":"${unit.id}",
-	"name":"$encoder.jsonEncode( ${unit.name} )"
+	"name":"$encoder.jsonEncode( ${unit.name} )",
+	"uid":"$encoder.jsonEncode( ${unit.uid} )"
   }#if( $velocityCount < $size ),#end
 #end
 ] }