← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15970: only allow legal values in optionset input in data-entry

 

------------------------------------------------------------
revno: 15970
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2014-07-05 14:24:38 +0700
message:
  only allow legal values in optionset input in data-entry
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-06-26 16:59:49 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-07-05 07:24:38 +0000
@@ -111,8 +111,8 @@
 
 DAO.store = new dhis2.storage.Store( {
     name: 'dhis2',
-    adapters: [ dhis2.storage.DomSessionStorageAdapter, dhis2.storage.InMemoryAdapter ],
-    objectStores: [ 'optionSets' ]
+    adapters: [ dhis2.storage.IndexedDBAdapter, dhis2.storage.DomSessionStorageAdapter, dhis2.storage.InMemoryAdapter ],
+    objectStores: [ 'optionSets', 'forms' ]
 } );
 
 ( function( $ ) {
@@ -2730,6 +2730,12 @@
             input.val( ui.item.value );
             input.autocomplete( 'close' );
             input.change();
+        },
+        change: function( event, ui ) {
+            if( ui.item == null ) {
+                $( this ).val("");
+                $( this ).focus();
+            }
         }
     } ).addClass( 'ui-widget' );