← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2821: Minor fix in data entry. The first descriptive option in the dataset/period list was added before...

 

------------------------------------------------------------
revno: 2821
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2011-02-06 08:08:06 +0100
message:
  Minor fix in data entry. The first descriptive option in the dataset/period list was added before the request for the list content was returned, which made the lists look confusing for a second on slow lines.
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	2011-02-04 08:12:04 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-02-06 07:08:06 +0000
@@ -45,12 +45,12 @@
     
     clearList( list );
     
-    addOptionToList( list, '-1', '[ ' + i18n_select_data_set + ' ]' );
-    
-    $.getJSON( url, function( json ) {
+    $.getJSON( url, function( json ) {    
     	$( '#selectedOrganisationUnit' ).val( json.organisationUnit.name );
     	$( '#currentOrganisationUnit' ).html( json.organisationUnit.name );
     	
+    	addOptionToList( list, '-1', '[ ' + i18n_select_data_set + ' ]' );
+    	
     	for ( i in json.dataSets ) {
     		addOptionToList( list, json.dataSets[i].id, json.dataSets[i].name );
     	}
@@ -95,9 +95,9 @@
 		
 	clearList( list );
 	    
-	addOptionToList( list, '-1', '[ ' + i18n_select_period + ' ]' );
+    $.getJSON( url, function( json ) {    	
+		addOptionToList( list, '-1', '[ ' + i18n_select_period + ' ]' );
 	
-    $.getJSON( url, function( json ) {
     	for ( i in json.periods ) {
     		addOptionToList( list, i, json.periods[i].name );
     	}
@@ -139,11 +139,11 @@
 		
 	    clearList( list );
 	    
-	    addOptionToList( list, '-1', '[ ' + i18n_select_period + ' ]' );
-		
 	    $.getJSON( url, function( json ) {
 	    	significantZeros = json.significantZeros;
 	    	
+	    	addOptionToList( list, '-1', '[ ' + i18n_select_period + ' ]' );
+		
 	    	for ( i in json.periods ) {
 	    		addOptionToList( list, i, json.periods[i].name );
 	    	}