← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20972: PT noext.

 

------------------------------------------------------------
revno: 20972
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-11-06 14:14:26 +0100
message:
  PT noext.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core2.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-pivot/scripts/core2.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core2.js	2015-11-06 12:50:52 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core2.js	2015-11-06 13:14:26 +0000
@@ -1043,8 +1043,8 @@
 
         // ResponseRow (array)
         (function() {
-            var ResponseRow = NS.Api.ResponseRow = function(row) {
-                var t = NS.arrayFrom(row);
+            var ResponseRow = NS.Api.ResponseRow = function(config) {
+                var t = NS.arrayFrom(config);
 
                 t.getAt = function(index) {
                     return this[index];
@@ -1186,16 +1186,16 @@
                     idValueMap = {},
                     idCombination;
 
-                this.rows.forEach(function(row) {
+                this.rows.forEach(function(responseRow) {
                     idCombination = new NS.Api.ResponseRowIdCombination();
 
                     headerIndexOrder.forEach(function(index) {
-                        idCombination.add(row.getAt(index));
+                        idCombination.add(responseRow.getAt(index));
                     });
 
-                    row.setIdCombination(idCombination);
+                    responseRow.setIdCombination(idCombination);
 
-                    idValueMap[idCombination.get()] = row.getAt(t.getValueHeaderIndex());
+                    idValueMap[idCombination.get()] = responseRow.getAt(t.getValueHeaderIndex());
                 });
 
                 return this.idValueMap = idValueMap;
@@ -1577,7 +1577,11 @@
                     tdCount = 0,
                     htmlArray,
                     dimConf = NS.conf.finals.dimension,
-                    styleConf = NS.conf.finals.style;
+                    styleConf = NS.conf.finals.style,
+
+                    //todo
+                    idValueMap = response.getIdValueMap(layout),
+                    conf = NS.conf;
 
 				response.sortableIdObjects = []; //todo
 
@@ -1908,7 +1912,7 @@
 	//				     [ dim, dim ] ];
 
 					// value
-					for (var i = 0, valueItemsRow, valueObjectsRow, idValueMap = xResponse.idValueMap; i < rowAxisSize; i++) {
+					for (var i = 0, valueItemsRow, valueObjectsRow; i < rowAxisSize; i++) {
 						valueItemsRow = [];
 						valueObjectsRow = [];
 
@@ -1986,7 +1990,7 @@
 								var totalId = 'total_' + rowAxis.ids[i],
 									isEmpty = !NS.arrayContains(empty, false);
 
-								xResponse.idValueMap[totalId] = isEmpty ? null : total;
+								idValueMap[totalId] = isEmpty ? null : total;
 							}
 
 							empty = [];