← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10400: (PT) Orgunit tree async issue for favorites fixed.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 10400 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-03-22 11:12:21 +0100
message:
  (PT) Orgunit tree async issue for favorites fixed.
modified:
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.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-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js	2013-03-21 11:45:40 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js	2013-03-22 10:09:49 +0000
@@ -3011,18 +3011,22 @@
 				},
 				numberOfRecords: 0,
 				recordsToSelect: [],
-				multipleSelectIf: function() {
+				multipleSelectIf: function(doUpdate) {
 					if (this.recordsToSelect.length === this.numberOfRecords) {
 						this.getSelectionModel().select(this.recordsToSelect);
 						this.recordsToSelect = [];
 						this.numberOfRecords = 0;
+						
+						if (doUpdate) {
+							update();
+						}
 					}
 				},
-				multipleExpand: function(id, path) {
+				multipleExpand: function(id, path, doUpdate) {					
 					this.expandPath('/' + pt.conf.finals.root.id + path, 'id', '/', function() {
 						var record = this.getRootNode().findChild('id', id, true);
 						this.recordsToSelect.push(record);
-						this.multipleSelectIf();
+						this.multipleSelectIf(doUpdate);
 					}, this);
 				},
 				select: function(url, params) {
@@ -3753,10 +3757,9 @@
 				// Organisation units
 				if (Ext.isArray(r.organisationUnits) && Ext.isObject(r.parentGraphMap)) {
 					treePanel.numberOfRecords = pt.util.object.getLength(r.parentGraphMap);
-
 					for (var key in r.parentGraphMap) {
 						if (r.parentGraphMap.hasOwnProperty(key)) {
-							treePanel.multipleExpand(key, r.parentGraphMap[key]);
+							treePanel.multipleExpand(key, r.parentGraphMap[key], true);
 						}
 					}
 				}
@@ -3871,7 +3874,10 @@
 					}
 				}
 
-				update();
+				// If fav has organisation units, execute from tree callback instead
+				if (!(Ext.isArray(r.organisationUnits) && Ext.isObject(r.parentGraphMap))) {
+					update();
+				}
 			};
 
 			viewport = Ext.create('Ext.container.Viewport', {

=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js	2013-03-21 15:03:54 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js	2013-03-22 10:09:49 +0000
@@ -984,7 +984,7 @@
 			validateUrl = function(url) {
 				if (!Ext.isString(url) || url.length > 2000) {
 					var percent = ((url.length - 2000) / url.length) * 100;
-					alert('Too many parameters selected. Please reduce the number of parameters by minimum ' + percent.toFixed(0) + '%.');
+					alert('Too many parameters selected. Please reduce the number of parameters by at least ' + percent.toFixed(0) + '%.');
 					return;
 				}