← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18896: support i18n db translation in selected/available widget

 

------------------------------------------------------------
revno: 18896
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-04-14 15:25:33 +0700
message:
  support i18n db translation in selected/available widget
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.selected.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/javascripts/dhis2/dhis2.selected.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.selected.js	2015-03-25 14:59:23 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.selected.js	2015-04-14 08:25:33 +0000
@@ -107,7 +107,7 @@
   $.fn.selected.defaults = {
     iterator: 'objects',
     handler: function( item ) {
-      return $('<option/>').val(item.id).text(item.name);
+      return $('<option/>').val(item.id).text(item.displayName);
     },
     defaultMoveSelected: function( sel ) {
       $(sel).find(':selected').trigger('dblclick');
@@ -165,7 +165,9 @@
         data: {
           paging: true,
           pageSize: 100 + context.target.children().length,
-          page: context.page
+          page: context.page,
+          translate: true,
+          fields: 'id,displayName'
         },
         dataType: 'json'
       };
@@ -218,7 +220,9 @@
       var request = {
         url: context.url,
         data: {
-          paging: false
+          paging: false,
+          translate: true,
+          fields: 'id,displayName'
         },
         dataType: 'json'
       };