← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4270: Cannot load orgunit tree when opening data entry form.

 

------------------------------------------------------------
revno: 4270
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-08-10 14:45:21 +0700
message:
  Cannot load orgunit tree when opening data entry form.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.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-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2011-08-09 08:50:30 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2011-08-10 07:45:21 +0000
@@ -63,7 +63,7 @@
 
             localStorage[getTagId( "Roots" )] = JSON.stringify( roots );
 
-            if ( sessionStorage[getTagId( "Selected" )] === undefined )
+            if ( sessionStorage[getTagId( "Selected" )] == null )
             {
                 if ( multipleSelectionAllowed )
                 {
@@ -80,7 +80,7 @@
                 subtree.reloadTree();
             }
 
-            selection.sync();
+            //selection.sync();
 
             $( "#ouwt_loader" ).hide();
         } );
@@ -89,7 +89,7 @@
     // server = true : sync from server
     // server = false : sync to server
     this.sync = function( server )
-    {
+    {	
         if ( server )
         {
             sessionStorage.removeItem( getTagId( "Selected" ) );
@@ -124,13 +124,13 @@
         {
             $.post( organisationUnitTreePath + "clearselected.action", function()
             {
-                if ( sessionStorage[getTagId( "Selected" )] === undefined )
+                if ( sessionStorage[getTagId( "Selected" )] == null )
                 {
                     return;
                 }
 
                 var selected = JSON.parse( sessionStorage[getTagId( "Selected" )] );
-
+		
                 if ( multipleSelectionAllowed )
                 {
                     if ( !$.isArray( selected ) )
@@ -152,11 +152,12 @@
                         selected = selected[0];
                     }
 
-                    $.post( organisationUnitTreePath + "setorgunit.action", {
-                        id : selected
-                    } );
-                }
-            } );
+					$.post( organisationUnitTreePath + "setorgunit.action", {
+							id : selected
+					},this.responseReceived );	
+				}					
+            });
+			
         }
     }
 
@@ -398,7 +399,7 @@
 
     expandTreeAtOrgUnit = function( ou )
     {
-        if ( localStorage[getTagId( ou )] === undefined )
+        if ( localStorage[getTagId( ou )] == null )
         {
             return;
         }
@@ -455,7 +456,7 @@
         var $treeTag = $( "#orgUnitTree" );
         $treeTag.children().eq( 0 ).remove();
 
-        if ( sessionStorage[getTagId( "Selected" )] === undefined )
+        if ( sessionStorage[getTagId( "Selected" )] == null )
         {
             var roots = JSON.parse( localStorage[getTagId( "Roots" )] );