=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js' --- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js 2010-09-30 14:35:12 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js 2010-10-03 23:41:38 +0000 @@ -3575,37 +3575,7 @@ proportionalSymbol, shapefilePanel, mapping, - adminPanel //, - // { - // xtype: 'print-multi', - // id: 'printMultiPage_p', - // title: 'Print multi page PDF', - // formConfig: { - // labelWidth: 65, - // bodyStyle: 'padding: 7px;', - // defaults: { - // width: 140, - // listWidth: 140 - // } - // }, - // columns: [ - // { - // header: 'Map title', - // width: 80, - // dataIndex: 'mapTitle', - // editor: new Ext.form.TextField() - // }, - // { - // header: 'Comment', - // dataIndex: 'comment', - // editor: new Ext.form.TextField() - // } - // ], - // border: false, - // map: MAP, - // configUrl: printConfigUrl, - // overrides: layerOverrides - // } + adminPanel ] }, { @@ -3758,219 +3728,9 @@ }}); }); -/* Section: select features */ -// var popup; - -// var featureWindow = new Ext.Window({ - // closeAction: 'hide', - // items: [ - // { - // xtype: 'menu', - // id: 'feature_m', - // floating: false, - // items: [ - // { - // html: 'Centre orgunit in the map', - // iconCls: 'no-icon', - // listeners: { - // 'click': { - // fn: function() { - // MAP.setCenter(FEATURE.geometry.getBounds().getCenterLonLat()); - // } - // } - // } - // }, - // { - // html: 'Indicator value timeseries', - // iconCls: 'no-icon', - // listeners: { - // 'click': { - // fn: function() { - // periodWindow.setPagePosition(Ext.getCmp('east').x - 262, Ext.getCmp('center').y + 135); - // periodWindow.show(); - // } - // } - // } - // } - // ] - // } - // ] -// }); - -// var periodTypeTimeseriesStore = new Ext.data.JsonStore({ - // url: path_mapping + 'getAllPeriodTypes' + type, - // root: 'periodTypes', - // fields: ['name'], - // autoLoad: true -// }); - -// var periodTimeseriesStore = new Ext.data.JsonStore({ - // url: path_mapping + 'getPeriodsByPeriodType' + type, - // baseParams: { name: 0 }, - // root: 'periods', - // fields: ['id', 'name', 'value'], - // autoLoad: false -// }); - -// var periodWindow = new Ext.Window({ - // title: 'Select periods', - // closeAction: 'hide', - // defaults: { bodyStyle: 'padding:8px; border:0px' }, - // width: 250, - // items: [ - // { - // xtype: 'panel', - // items: [ - // { html: '
Period type
' }, - // { - // xtype: 'combo', - // id: 'periodtypetimeseries_cb', - // fieldLabel: 'Period type', - // typeAhead: true, - // editable: false, - // valueField: 'name', - // displayField: 'name', - // mode: 'remote', - // forceSelection: true, - // triggerAction: 'all', - // emptyText: emptytext, - // labelSeparator: labelseparator, - // selectOnFocus: true, - // width: combo_width, - // store: periodTypeTimeseriesStore, - // listeners: { - // 'select': { - // fn: function() { - // var pt = Ext.getCmp('periodtypetimeseries_cb').getValue(); - // periodTimeseriesStore.baseParams = { name: pt }; - // periodTimeseriesStore.load(); - // }, - // scope: this - // } - // } - // }, - // { html: '
Periods
' }, - // { - // xtype: 'multiselect', - // id: 'periodstimeseries_ms', - // dataFields: ['id', 'name'], - // valueField: 'id', - // displayField: 'name', - // width: multiselect_width, - // height: GLOBALS.util.getMultiSelectHeight(), - // store: periodTimeseriesStore - // }, - // { html: '
Window width
' }, - // { - // xtype: 'textfield', - // id: 'timeserieswindowwidth_tf', - // value: 800, - // width: combo_number_width - // }, - // { html: '
Window height
' }, - // { - // xtype: 'textfield', - // id: 'timeserieswindowheight_tf', - // value: 400, - // width: combo_number_width - // }, - // { - // xtype: 'button', - // id: 'timeseries_b', - // isFormField: true, - // hideLabel: true, - // cls: 'window-button', - // text: 'Create graph', - // handler: function() { - // var iid = Ext.getCmp('indicator_cb').getValue(); - // var pids = Ext.getCmp('periodstimeseries_ms').getValue(); - - // var pidArray = new Array(); - // pidArray = pids.split(','); - - // var pnameArray = new Array(); - // for (var i = 0; i < pidArray.length; i++) { - // pnameArray[i] = [i, periodTimeseriesStore.getById(pidArray[i]).data.name]; - // } - - // setMapValueTimeseriesStore(iid, pidArray, pnameArray, URL); - // mapValueTimeseriesStore.load(); - // } - // } - // ] - // } - // ] -// }); - -// var mapValueTimeseriesStore; - -// function setMapValueTimeseriesStore(iid, pidArray, pnameArray, URL) { - // var params = pidArray[0]; - // if (pidArray.length > 1) { - // for (var i = 1; i < pidArray.length; i++) { - // params += '&periodIds=' + pidArray[i]; - // } - // } - - // mapValueTimeseriesStore = new Ext.data.JsonStore({ - // url: path_mapping + 'getIndicatorMapValuesByMapAndFeatureId' + type + '?indicatorId=' + iid + '&mapLayerPath=' + URL + '&featureId=' + FEATURE.attributes[MAPDATA.nameColumn] + '&periodIds=' + params, - // root: 'mapvalues', - // fields:['orgUnitId', 'orgUnitName', 'featureId', 'periodId', 'value'], - // autoLoad: false, - // listeners: { - // 'load': { - // fn: function() { - // var title = FEATURE.attributes[MAPDATA.nameColumn]; - // var indicator = Ext.getCmp('indicator_cb').getRawValue(); - - // var valueArray = new Array(); - // for (var i = 0; i < pidArray.length; i++) { - // for (var j = 0; j < mapValueTimeseriesStore.getCount(); j++) { - // if (mapValueTimeseriesStore.getAt(j).data.periodId == pidArray[i]) { - // valueArray[i] = [i, parseFloat(mapValueTimeseriesStore.getAt(j).data.value)]; - // } - // } - // } - - // CHART = getChart(title + ', ' + indicator, pnameArray, FEATURE.attributes[MAPDATA.nameColumn], valueArray); - // CHART.show(); - // } - // } - // } - // }); -// } - -// function getChart(title, pnameArray, name, valueArray) { - // var width = Ext.getCmp('timeserieswindowwidth_tf').getValue() || 800; - // var height = Ext.getCmp('timeserieswindowheight_tf').getValue() || 400; - - // return new Ext.Window({ - // title: title, - // defaults: { bodyStyle: 'padding:10px 32px 12px 22px; border:0px' }, - // items: [{ - // xtype: 'panel', - // items: [{ - // xtype: 'flot', - // width: 1000, - // height: 300, - // series: [valueArray], - // xaxis: { - // ticks: pnameArray - // } - // }] - // }] - // }); -// } - -// var chartWindow = new Ext.Window({ - // closeAction: 'hide', - // defaults: { bodyStyle: 'padding:8px; border:0px' }, - // items: CHART -// }); - +/* Section: select features polygon */ var popup; -/* Section: select features polygon */ function onHoverSelectPolygon(feature) { FEATURE[thematicMap] = feature; === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js' --- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js 2010-09-30 14:35:12 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js 2010-10-03 23:41:38 +0000 @@ -74,6 +74,8 @@ stores: false, + selectFeatures: false, + initComponent: function() { this.legend = {}; this.legend.type = map_legend_type_automatic; @@ -82,7 +84,7 @@ this.mapData = {}; this.valueType = map_value_type_indicator; - mapViewStore = new Ext.data.JsonStore({ + var mapViewStore = new Ext.data.JsonStore({ url: path_mapping + 'getAllMapViews' + type, root: 'mapViews', fields: ['id', 'name'], @@ -143,7 +145,7 @@ Ext.getCmp('maplegendset_cb').setValue(this.mapView.mapLegendSetId); - predefinedMapLegendSetStore.load(); + this.stores.predefinedMapLegendSetStore.load(); } Ext.getCmp('mapvaluetype_cb').setValue(this.mapView.mapValueType); @@ -156,8 +158,8 @@ Ext.getCmp('indicatorgroup_cb').setValue(this.mapView.indicatorGroupId); - indicatorStore.setBaseParam('indicatorGroupId', this.mapView.indicatorGroupId); - indicatorStore.load(); + this.stores.indicatorStore.setBaseParam('indicatorGroupId', this.mapView.indicatorGroupId); + this.stores.indicatorStore.load(); } else if (this.mapView.mapValueType == map_value_type_dataelement) { Ext.getCmp('indicator_cb').hideField(); @@ -167,8 +169,8 @@ Ext.getCmp('dataelementgroup_cb').setValue(this.mapView.dataElementGroupId); - dataElementStore.setBaseParam('dataElementGroupId', this.mapView.dataElementGroupId); - dataElementStore.load(); + this.stores.dataElementStore.setBaseParam('dataElementGroupId', this.mapView.dataElementGroupId); + this.stores.dataElementStore.load(); } if (MAPDATETYPE == map_date_type_fixed) { @@ -194,7 +196,7 @@ } }); - indicatorGroupStore = new Ext.data.JsonStore({ + var indicatorGroupStore = new Ext.data.JsonStore({ url: path_mapping + 'getAllIndicatorGroups' + type, root: 'indicatorGroups', fields: ['id', 'name'], @@ -203,18 +205,18 @@ autoLoad: true }); - indicatorStore = new Ext.data.JsonStore({ + var indicatorStore = new Ext.data.JsonStore({ url: path_mapping + 'getIndicatorsByIndicatorGroup' + type, root: 'indicators', fields: ['id', 'name', 'shortName'], idProperty: 'id', - sortInfo: { field: 'name', direction: 'ASC' }, + sortInfo: {field: 'name', direction: 'ASC'}, autoLoad: false, listeners: { 'load': { scope: this, - fn: function() { - indicatorStore.each( + fn: function(store) { + store.each( function fn(record) { var name = record.get('name'); name = name.replace('<', '<').replace('>', '>'); @@ -233,8 +235,8 @@ Ext.getCmp('startdate_df').hideField(); Ext.getCmp('enddate_df').hideField(); Ext.getCmp('periodtype_cb').setValue(this.mapView.periodTypeId); - periodStore.setBaseParam('name', this.mapView.periodTypeId); - periodStore.load(); + this.stores.periodStore.setBaseParam('name', this.mapView.periodTypeId); + this.stores.periodStore.load(); } else if (this.mapView.mapDateType == map_date_type_start_end) { Ext.getCmp('periodtype_cb').hideField(); @@ -273,7 +275,7 @@ } }); - dataElementGroupStore = new Ext.data.JsonStore({ + var dataElementGroupStore = new Ext.data.JsonStore({ url: path_mapping + 'getAllDataElementGroups' + type, root: 'dataElementGroups', fields: ['id', 'name'], @@ -281,7 +283,7 @@ autoLoad: true }); - dataElementStore = new Ext.data.JsonStore({ + var dataElementStore = new Ext.data.JsonStore({ url: path_mapping + 'getDataElementsByDataElementGroup' + type, root: 'dataElements', fields: ['id', 'name', 'shortName'], @@ -290,8 +292,8 @@ listeners: { 'load': { scope: this, - fn: function() { - dataElementStore.each( + fn: function(store) { + store.each( function fn(record) { var name = record.get('name'); name = name.replace('<', '<').replace('>', '>'); @@ -311,8 +313,8 @@ Ext.getCmp('enddate_df').hideField(); Ext.getCmp('periodtype_cb').setValue(this.mapView.periodTypeId); - periodStore.setBaseParam('name', this.mapView.periodTypeId); - periodStore.load(); + this.stores.periodStore.setBaseParam('name', this.mapView.periodTypeId); + this.stores.periodStore.load(); } else if (this.mapView.mapDateType == map_date_type_start_end) { Ext.getCmp('periodtype_cb').hideField(); @@ -351,14 +353,14 @@ } }); - periodTypeStore = new Ext.data.JsonStore({ + var periodTypeStore = new Ext.data.JsonStore({ url: path_mapping + 'getAllPeriodTypes' + type, root: 'periodTypes', fields: ['name'], autoLoad: true }); - periodStore = new Ext.data.JsonStore({ + var periodStore = new Ext.data.JsonStore({ url: path_mapping + 'getPeriodsByPeriodType' + type, root: 'periods', fields: ['id', 'name'], @@ -389,7 +391,7 @@ } }); - mapStore = new Ext.data.JsonStore({ + var mapStore = new Ext.data.JsonStore({ url: path_mapping + 'getAllMaps' + type, baseParams: { format: 'jsonmin' }, root: 'maps', @@ -428,7 +430,7 @@ } }); - predefinedMapLegendSetStore = new Ext.data.JsonStore({ + var predefinedMapLegendSetStore = new Ext.data.JsonStore({ url: path_mapping + 'getMapLegendSetsByType' + type, baseParams: {type: map_legend_type_predefined}, root: 'mapLegendSets', @@ -487,7 +489,7 @@ selectOnFocus: true, labelSeparator: labelseparator, width: combo_width, - store: mapViewStore, + store: this.stores.mapViewStore, listeners: { 'select': { scope: this, @@ -513,8 +515,8 @@ Ext.getCmp('dataelement_cb').hideField(); Ext.getCmp('indicatorgroup_cb').setValue(this.mapView.indicatorGroupId); - indicatorStore.setBaseParam('indicatorGroupId', this.mapView.indicatorGroupId); - indicatorStore.load(); + this.stores.indicatorStore.setBaseParam('indicatorGroupId', this.mapView.indicatorGroupId); + this.stores.indicatorStore.load(); } else if (this.mapView.mapValueType == map_value_type_dataelement) { Ext.getCmp('indicatorgroup_cb').hideField(); @@ -523,8 +525,8 @@ Ext.getCmp('dataelement_cb').showField(); Ext.getCmp('dataelementgroup_cb').setValue(this.mapView.dataElementGroupId); - dataElementStore.setBaseParam('dataElementGroupId', this.mapView.dataElementGroupId); - dataElementStore.load(); + this.stores.dataElementStore.setBaseParam('dataElementGroupId', this.mapView.dataElementGroupId); + this.stores.dataElementStore.load(); } if (this.mapView.mapLegendType == map_legend_type_automatic) { @@ -630,17 +632,18 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: indicatorGroupStore, + store: this.stores.indicatorGroupStore, listeners: { 'select': { - fn: function() { + scope: this, + fn: function(cb) { if (Ext.getCmp('mapview_cb').getValue()) { Ext.getCmp('mapview_cb').clearValue(); } Ext.getCmp('indicator_cb').clearValue(); - indicatorStore.setBaseParam('indicatorGroupId', this.getValue()); - indicatorStore.load(); + this.stores.indicatorStore.setBaseParam('indicatorGroupId', cb.getValue()); + this.stores.indicatorStore.load(); } } } @@ -661,7 +664,7 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: indicatorStore, + store: this.stores.indicatorStore, listeners: { 'select': { scope: this, @@ -735,16 +738,17 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: dataElementGroupStore, + store: this.stores.dataElementGroupStore, listeners: { 'select': { - fn: function() { + scope: this, + fn: function(cb) { if (Ext.getCmp('mapview_cb').getValue()) { Ext.getCmp('mapview_cb').clearValue(); } Ext.getCmp('dataelement_cb').clearValue(); - dataElementStore.setBaseParam('dataElementGroupId', this.getValue()); - dataElementStore.load(); + this.stores.dataElementStore.setBaseParam('dataElementGroupId', cb.getValue()); + this.stores.dataElementStore.load(); } } } @@ -765,7 +769,7 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: dataElementStore, + store: this.stores.dataElementStore, listeners: { 'select': { scope: this, @@ -839,16 +843,17 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: periodTypeStore, + store: this.stores.periodTypeStore, listeners: { 'select': { - fn: function() { + scope: this, + fn: function(cb) { if (Ext.getCmp('mapview_cb').getValue() != '') { Ext.getCmp('mapview_cb').clearValue(); } Ext.getCmp('period_cb').clearValue(); - Ext.getCmp('period_cb').getStore().setBaseParam('name', this.getValue()); + Ext.getCmp('period_cb').getStore().setBaseParam('name', cb.getValue()); Ext.getCmp('period_cb').getStore().load(); } } @@ -870,7 +875,7 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: periodStore, + store: this.stores.periodStore, listeners: { 'select': { scope: this, @@ -939,7 +944,7 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: mapStore, + store: this.stores.mapStore, listeners: { 'select': { scope: this, @@ -1161,7 +1166,7 @@ triggerAction: 'all', width: combo_width, hidden: true, - store: predefinedMapLegendSetStore, + store: this.stores.predefinedMapLegendSetStore, listeners: { 'select': { scope: this, === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js' --- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js 2010-09-30 14:35:12 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Mapping.js 2010-10-03 23:41:38 +0000 @@ -175,7 +175,7 @@ handler: function() { if (!Ext.getCmp('maps_cb').getValue()) { - Ext.message.msg(false, i18n_please_select_map ); + Ext.message.msg(false, i18n_please_select_map); return; } mapping.autoAssign(true); @@ -225,7 +225,7 @@ handler: function() { if (!Ext.getCmp('maps_cb').getValue()) { - Ext.message.msg(false, i18n_please_select_map ); + Ext.message.msg(false, i18n_please_select_map); return; } @@ -234,7 +234,7 @@ var msg; if (selection == '') { - Ext.message.msg(false, i18n_please_select_least_one_organisation_unit_in_the_list ); + Ext.message.msg(false, i18n_please_select_least_one_organisation_unit_in_the_list); return; } @@ -264,7 +264,7 @@ mapping.classify(true, true); }, failure: function() { - alert( i18n_error_while_deleting_relation_map_and_oranisation_unit ); + alert(i18n_error_while_deleting_relation_map_and_oranisation_unit); } }); }, @@ -454,7 +454,7 @@ MASK.msg = i18n_applying_organisation_units_relations ; MASK.show(); - Ext.message.msg(true, '' + count_match + ' '+ i18n_organisation_units_assigned + ' (map ' + FEATURE[thematicMap].length + ', db ' + organisationUnits.length + ').'); + Ext.message.msg(true, '' + count_match + ' '+ i18n_organisation_units_assigned + ' (map ' + FEATURE[thematicMap].length + ', db ' + organisationUnits.length + ')'); Ext.getCmp('grid_gp').getStore().load(); mapping.classify(false, position); === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js' --- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js 2010-09-30 14:35:12 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js 2010-10-03 23:41:38 +0000 @@ -79,10 +79,9 @@ this.legend.type = map_legend_type_automatic; this.legend.method = 2; this.legend.classes = 5; - this.mapData = {}; - mapViewStore = new Ext.data.JsonStore({ + var mapViewStore = new Ext.data.JsonStore({ url: path_mapping + 'getAllMapViews' + type, root: 'mapViews', fields: ['id', 'name'], @@ -90,7 +89,7 @@ autoLoad: true }); - indicatorGroupStore = new Ext.data.JsonStore({ + var indicatorGroupStore = new Ext.data.JsonStore({ url: path_mapping + 'getAllIndicatorGroups' + type, root: 'indicatorGroups', fields: ['id', 'name'], @@ -99,18 +98,18 @@ autoLoad: true }); - indicatorStore = new Ext.data.JsonStore({ + var indicatorStore = new Ext.data.JsonStore({ url: path_mapping + 'getIndicatorsByIndicatorGroup' + type, root: 'indicators', fields: ['id', 'name', 'shortName'], idProperty: 'id', - sortInfo: { field: 'name', direction: 'ASC' }, + sortInfo: {field: 'name', direction: 'ASC'}, autoLoad: false, listeners: { 'load': { scope: this, - fn: function() { - indicatorStore.each( + fn: function(store) { + store.each( function fn(record) { var name = record.get('name'); name = name.replace('<', '<').replace('>', '>'); @@ -127,11 +126,10 @@ Ext.getCmp('periodtype_cb2').showField(); Ext.getCmp('period_cb2').showField(); Ext.getCmp('startdate_df2').hideField(); - Ext.getCmp('enddate_df2').hideField(); - + Ext.getCmp('enddate_df2').hideField(); Ext.getCmp('periodtype_cb2').setValue(this.mapView.periodTypeId); - periodStore.setBaseParam('name', this.mapView.periodTypeId); - periodStore.load(); + this.stores.periodStore.setBaseParam('name', this.mapView.periodTypeId); + this.stores.periodStore.load(); } else if (this.mapView.mapDateType == map_date_type_start_end) { Ext.getCmp('periodtype_cb2').hideField(); @@ -170,7 +168,7 @@ } }); - dataElementGroupStore = new Ext.data.JsonStore({ + var dataElementGroupStore = new Ext.data.JsonStore({ url: path_mapping + 'getAllDataElementGroups' + type, root: 'dataElementGroups', fields: ['id', 'name'], @@ -178,7 +176,7 @@ autoLoad: true }); - dataElementStore = new Ext.data.JsonStore({ + var dataElementStore = new Ext.data.JsonStore({ url: path_mapping + 'getDataElementsByDataElementGroup' + type, root: 'dataElements', fields: ['id', 'name', 'shortName'], @@ -187,8 +185,8 @@ listeners: { 'load': { scope: this, - fn: function() { - dataElementStore.each( + fn: function(store) { + store.each( function fn(record) { var name = record.get('name'); name = name.replace('<', '<').replace('>', '>'); @@ -208,8 +206,8 @@ Ext.getCmp('enddate_df2').hideField(); Ext.getCmp('periodtype_cb2').setValue(this.mapView.periodTypeId); - periodStore.setBaseParam('name', this.mapView.periodTypeId); - periodStore.load(); + this.stores.periodStore.setBaseParam('name', this.mapView.periodTypeId); + this.stores.periodStore.load(); } else if (this.mapView.mapDateType == map_date_type_start_end) { Ext.getCmp('periodtype_cb2').hideField(); @@ -248,14 +246,14 @@ } }); - periodTypeStore = new Ext.data.JsonStore({ + var periodTypeStore = new Ext.data.JsonStore({ url: path_mapping + 'getAllPeriodTypes' + type, root: 'periodTypes', fields: ['name'], autoLoad: true }); - - periodStore = new Ext.data.JsonStore({ + + var periodStore = new Ext.data.JsonStore({ url: path_mapping + 'getPeriodsByPeriodType' + type, root: 'periods', fields: ['id', 'name'], @@ -286,7 +284,7 @@ } }); - mapStore = new Ext.data.JsonStore({ + var mapStore = new Ext.data.JsonStore({ url: path_mapping + 'getAllMaps' + type, baseParams: { format: 'jsonmin' }, root: 'maps', @@ -325,7 +323,7 @@ } }); - predefinedMapLegendSetStore = new Ext.data.JsonStore({ + var predefinedMapLegendSetStore = new Ext.data.JsonStore({ url: path_mapping + 'getMapLegendSetsByType' + type, baseParams: {type: map_legend_type_predefined}, root: 'mapLegendSets', @@ -385,7 +383,7 @@ selectOnFocus: true, labelSeparator: labelseparator, width: combo_width, - store: choropleth.stores.mapViewStore, + store: this.stores.mapViewStore, listeners: { 'select': { scope: this, @@ -413,8 +411,8 @@ Ext.getCmp('dataelement_cb2').hideField(); Ext.getCmp('indicatorgroup_cb2').setValue(this.mapView.indicatorGroupId); - indicatorStore.setBaseParam('indicatorGroupId', this.mapView.indicatorGroupId); - indicatorStore.load(); + this.stores.indicatorStore.setBaseParam('indicatorGroupId', this.mapView.indicatorGroupId); + this.stores.indicatorStore.load(); } else if (this.mapView.mapValueType == map_value_type_dataelement) { Ext.getCmp('indicatorgroup_cb2').hideField(); @@ -423,8 +421,8 @@ Ext.getCmp('dataelement_cb2').showField(); Ext.getCmp('dataelementgroup_cb2').setValue(this.mapView.dataElementGroupId); - dataElementStore.setBaseParam('dataElementGroupId', this.mapView.dataElementGroupId); - dataElementStore.load(); + this.stores.dataElementStore.setBaseParam('dataElementGroupId', this.mapView.dataElementGroupId); + this.stores.dataElementStore.load(); } if (this.mapView.mapLegendType == map_legend_type_automatic) { @@ -530,17 +528,18 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: indicatorGroupStore, + store: this.stores.indicatorGroupStore, listeners: { 'select': { - fn: function() { + scope: this, + fn: function(cb) { if (Ext.getCmp('mapview_cb2').getValue()) { Ext.getCmp('mapview_cb2').clearValue(); } Ext.getCmp('indicator_cb2').clearValue(); - indicatorStore.setBaseParam('indicatorGroupId', this.getValue()); - indicatorStore.load(); + this.stores.indicatorStore.setBaseParam('indicatorGroupId', cb.getValue()); + this.stores.indicatorStore.load(); } } } @@ -561,7 +560,7 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: indicatorStore, + store: this.stores.indicatorStore, listeners: { 'select': { scope: this, @@ -635,16 +634,17 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: dataElementGroupStore, + store: this.stores.dataElementGroupStore, listeners: { 'select': { - fn: function() { + scope: this, + fn: function(cb) { if (Ext.getCmp('mapview_cb2').getValue()) { Ext.getCmp('mapview_cb2').clearValue(); } Ext.getCmp('dataelement_cb2').clearValue(); - dataElementStore.setBaseParam('dataElementGroupId', this.getValue()); - dataElementStore.load(); + this.stores.dataElementStore.setBaseParam('dataElementGroupId', cb.getValue()); + this.stores.dataElementStore.load(); } } } @@ -665,7 +665,7 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: dataElementStore, + store: this.stores.dataElementStore, listeners: { 'select': { scope: this, @@ -739,7 +739,7 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: periodTypeStore, + store: this.stores.periodTypeStore, listeners: { 'select': { fn: function() { @@ -770,7 +770,7 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: periodStore, + store: this.stores.periodStore, listeners: { 'select': { scope: this, @@ -839,7 +839,7 @@ labelSeparator: labelseparator, selectOnFocus: true, width: combo_width, - store: mapStore, + store: this.stores.mapStore, listeners: { 'select': { scope: this, @@ -1061,7 +1061,7 @@ triggerAction: 'all', width: combo_width, hidden: true, - store: predefinedMapLegendSetStore, + store: this.stores.predefinedMapLegendSetStore, listeners: { 'select': { scope: this,