← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13925: GIS, action -> web api.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 13925 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-02-04 11:09:36 +0100
message:
  GIS, action -> web api.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/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-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2014-02-03 12:57:11 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2014-02-04 10:07:24 +0000
@@ -538,32 +538,6 @@
 
 			store.groupsByGroupSet = Ext.create('Ext.data.Store', {
 				fields: ['id', 'name', 'symbol'],
-				proxy: {
-					type: 'ajax',
-					url: '',
-					noCache: false,
-					reader: {
-						type: 'json',
-						root: 'organisationUnitGroups'
-					}
-				},
-				isLoaded: false,
-				loadFn: function(fn) {
-					if (this.isLoaded) {
-						fn.call();
-					}
-					else {
-						this.load(fn);
-					}
-				},
-				listeners: {
-					load: function() {
-						if (!this.isLoaded) {
-							this.isLoaded = true;
-						}
-						this.sort('name', 'ASC');
-					}
-				}
 			});
 
 			store.organisationUnitGroup = Ext.create('Ext.data.Store', {

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js	2014-02-03 12:57:11 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js	2014-02-04 10:07:24 +0000
@@ -1342,15 +1342,15 @@
 		loadLegend = function(view) {
 			view = view || layer.core.view;
 
-			var store = gis.store.groupsByGroupSet;
+            Ext.data.JsonP.request({
+                url: gis.init.contextPath + '/api/organisationUnitGroupSets/' + view.organisationUnitGroupSet.id + '.jsonp?links=false',
+                success: function(r) {
+                    var data = r.organisationUnitGroups,
+                        options = {
+                            indicator: view.organisationUnitGroupSet.id
+                        };
 
-			store.proxy.url = gis.init.contextPath + gis.conf.finals.url.path_module + 'getOrganisationUnitGroupsByGroupSet.action?id=' + view.organisationUnitGroupSet.id;
-			store.load({
-				scope: this,
-				callback: function() {
-					var options = {
-						indicator: view.organisationUnitGroupSet.id
-					};
+                    gis.store.groupsByGroupSet.loadData(data);
 
 					layer.core.view = view;