------------------------------------------------------------
revno: 15926
committer: Morten Olav Hansen <[email protected]>
branch nick: dhis2
timestamp: Tue 2014-07-01 17:03:58 +0800
message:
  sort dataset list in dhis-web-mobile
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	2014-03-13 09:45:32 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm	2014-07-01 09:03:58 +0000
@@ -59,8 +59,21 @@
   var organisationUnit = fm.organisationUnit(Selected.orgUnit);
   var tmpl = $('#data-sets-template').html();
 
+  var dataSets = organisationUnit.dataSets.sort(function(a, b) {
+      var labelA = a.label.toLowerCase();
+      var labelB = b.label.toLowerCase();
+
+      if( labelA < labelB ) {
+          return -1;
+      } else if( labelA > labelB ) {
+          return 1;
+      }
+
+      return 0;
+  });
+
   $('#data-sets-page section[data-role="content"]').html(
-      _.template(tmpl, { 'dataSets': organisationUnit.dataSets })
+      _.template(tmpl, { 'dataSets': dataSets })
   );
 
   $('#data-set-list').listview();

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to