Skip to content

Commit

Permalink
Rework map projection list on startup to prepare store first and load…
Browse files Browse the repository at this point in the history
… data in webgisinit
  • Loading branch information
uprel committed Feb 14, 2019
1 parent fb9973b commit ae1f953
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
24 changes: 19 additions & 5 deletions client/site/js/GUI.js
Expand Up @@ -351,19 +351,33 @@ MyViewportUi = Ext.extend(Ext.Viewport, {
}, {
xtype: 'tbfill'
}, {
xtype: 'combo',
id: 'rightStatusText',
xtype: 'combo',
id: 'rightStatusText',
valueField: 'code',
displayField: 'description',
hideLabel: true,
editable: false,
mode: 'local',
triggerAction: 'all',
width: 160,
store: projectData.crsComboStore(),
value: projectData.crsComboStore()[0][1],
store: {
xtype: 'arraystore',
// store configs
autoDestroy: true,
storeId: 'crsStore',
// reader configs
idIndex: 0,
fields: [{
name: 'code', mapping: 0
}, {
name: 'description', mapping: 1
}]
},
//value: projectData.crsComboStore()[0][1],
listeners: {
"select": function(combo, record, index) {
Eqwc.currentMapProjection = projectData.getProjectionsList().filter(function (val) {
return val[0] === record.data.field1;
return val[0] === record.data.code;
})[0];
}
//"render": function(c) {
Expand Down
4 changes: 4 additions & 0 deletions client/site/js/WebgisInit.js
Expand Up @@ -108,6 +108,10 @@ Ext.onReady(function () {
mainStatusText = Ext.getCmp('mainStatusText');
rightStatusText = Ext.getCmp('rightStatusText');

//set crs values
rightStatusText.store.loadData(projectData.crsComboStore());
rightStatusText.setValue(projectData.crsComboStore()[0][1]);

//set some status messsages
mainStatusText.setText(mapAppLoadingString[lang]);

Expand Down

0 comments on commit ae1f953

Please sign in to comment.