← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12672: sort OUs in mobile client using ou.level as sorter

 

------------------------------------------------------------
revno: 12672
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-10-15 13:45:28 +0200
message:
  sort OUs in mobile client using ou.level as sorter
modified:
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.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-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm	2013-09-20 15:13:05 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm	2013-10-15 11:45:28 +0000
@@ -31,8 +31,11 @@
         var organisationUnits = fm.organisationUnits();
         var tmpl = $( '#organisation-units-template' ).html();
 
+        var ou = _.values( organisationUnits );
+        ou = _.sortBy( ou, function(n) { return n.level; } );
+
         $('#organisation-units-page section[data-role="content"]').html(
-            _.template( tmpl, { 'organisationUnits': organisationUnits } )
+            _.template( tmpl, { 'organisationUnits': ou } )
         );
 
         $('#organisation-unit-list').listview();