← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16576: Agg data entry, supporting option sets

 

------------------------------------------------------------
revno: 16576
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-08-29 16:07:04 +0200
message:
  Agg data entry, supporting option sets
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-08-07 09:15:03 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-08-29 14:07:04 +0000
@@ -2568,7 +2568,7 @@
                             break;
                         }
 
-                        if ( item.toLowerCase().indexOf( query ) != -1 ) {
+                        if ( item.name.toLowerCase().indexOf( query ) != -1 ) {
                             options.push( item );
                         }
                     }
@@ -2576,11 +2576,11 @@
 
                 success( $.map( options, function ( item ) {
                     return {
-                        label: item,
-                        id: item
+                        label: item.name,
+                        id: item.code
                     };
                 } ) );
-            } 
+            }
             else {
                 dhis2.de.getOptions( uid, query, success );
             }
@@ -2605,8 +2605,8 @@
         success: function ( data ) {
             success( $.map( data.options, function ( item ) {
                 return {
-                    label: item,
-                    id: item
+                    label: item.name,
+                    id: item.code
                 };
             } ) );
         }
@@ -2659,7 +2659,7 @@
 };
 
 /**
- * Insersts option sets in the appropriate input fields.
+ * Inserts option sets in the appropriate input fields.
  */
 dhis2.de.insertOptionSets = function() 
 {
@@ -2675,7 +2675,8 @@
 
         item = item + '-val';
         optionSetKey = optionSetKey.dataElementId + '-' + optionSetKey.optionComboId;
-        dhis2.de.autocompleteOptionSetField( item, dhis2.de.optionSets[optionSetKey].uid );
+        var optionSetUid = dhis2.de.optionSets[optionSetKey].uid;
+        dhis2.de.autocompleteOptionSetField( item, optionSetUid );
     } );
 };