← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20832: ER legend set issue fixed.

 

------------------------------------------------------------
revno: 20832
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-10-21 17:24:49 +0200
message:
  ER legend set issue fixed.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.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-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js	2015-10-12 18:39:03 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js	2015-10-21 15:24:49 +0000
@@ -171,7 +171,9 @@
                     }
                 }
                 else if (record.filter) {
-                    this.rangeSetCmp.pendingValue = defaultRangeSetId;
+                    //this.rangeSetCmp.pendingValue = defaultRangeSetId;
+                    this.rangeSetCmp.setValue(defaultRangeSetId); //todo?
+                    this.onRangeSetSelect(defaultRangeSetId);
 
 					var a = record.filter.split(':');
 
@@ -179,7 +181,6 @@
                         this.operatorCmp.setValue(a[0]);
                         this.valueCmp.setValue(a[1]);
                     }
-                    else {}
 				}
 			},
             initComponent: function() {
@@ -419,8 +420,11 @@
                                 name: 'No range set'
                             });
 
-                            if (container.dataElement.legendSet) {
-                                var legendSet = ns.core.init.idLegendSetMap[container.dataElement.legendSet.id];
+                            var de = container.dataElement;
+
+                            if (de.legendSet || de.storageLegendSet) {
+                                var id = de.legendSet ? de.legendSet.id : (de.storageLegendSet ? de.storageLegendSet.id : null),
+                                    legendSet = ns.core.init.idLegendSetMap[id];
 
                                 if (Ext.isObject(legendSet)) {
                                     cb.store.add(legendSet);
@@ -4507,7 +4511,7 @@
             }
             else {
                 Ext.Ajax.request({
-                    url: ns.core.init.contextPath + '/api/programStages.json?filter=id:eq:' + stageId + '&fields=programStageDataElements[dataElement[id,' + ns.core.init.namePropertyUrl + ',valueType,optionSet[id,name],legendSet[id,name]]]',
+                    url: ns.core.init.contextPath + '/api/programStages.json?filter=id:eq:' + stageId + '&fields=programStageDataElements[dataElement[id,' + ns.core.init.namePropertyUrl + ',valueType,optionSet[id,name],legendSet|rename(storageLegendSet)[id,name]]]',
                     success: function(r) {
                         var objects = Ext.decode(r.responseText).programStages,
                             dataElements;