← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4165: finished jquerification of ouwt

 

------------------------------------------------------------
revno: 4165
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-07-19 11:17:01 +0200
message:
  finished jquerification of ouwt
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-07-19 08:56:39 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2011-07-19 09:17:01 +0000
@@ -143,31 +143,33 @@
     {
         var children = $( "#" + getTagId( unitId ) ).find( "ul" );
 
-        var request = new Request();
-        request.setResponseTypeXML( 'units' );
-
         if ( children.length < 1 || !isVisible( children[0] ) )
         {
-            request.setCallbackSuccess( processExpand );
-            request.send( organisationUnitTreePath + 'expandSubtree.action?parentId=' + unitId );
+            $.ajax( {
+                url : organisationUnitTreePath + 'expandSubtree.action',
+                data : {
+                    'parentId' : unitId
+                },
+                success : processExpand
+            } );
         } else
         {
-            request.setCallbackSuccess( processCollapse );
-            request.send( organisationUnitTreePath + 'collapseSubtree.action?parentId=' + unitId );
+            $.ajax( {
+                url : organisationUnitTreePath + 'collapseSubtree.action',
+                data : {
+                    'parentId' : unitId
+                },
+                success : processCollapse
+            } );
         }
     };
 
     this.refreshTree = function()
     {
-        var treeTag = document.getElementById( 'orgUnitTree' );
-
-        var children = treeTag.getElementsByTagName( 'ul' );
-        treeTag.removeChild( children[0] );
-
-        var request = new Request();
-        request.setResponseTypeXML( 'units' );
-        request.setCallbackSuccess( treeReceived );
-        request.send( organisationUnitTreePath + 'getExpandedTree.action' );
+        var $treeTag = $( "#orgUnitTree" );
+        $treeTag.children().eq( 0 ).remove();
+
+        $.get( organisationUnitTreePath + "getExpandedTree.action", treeReceived );
     };
 
     function processCollapse( rootElement )