dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31282
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15926: sort dataset list in dhis-web-mobile
------------------------------------------------------------
revno: 15926
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
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();