comparison app/view/panel/Ort.js @ 1361:5c2d6812d85a

Merge behaviour of Stammdaten panel and ortszuordnungs grid according to the recent changes in Ortszuordnung and Ortserstellung.
author Maximilian Krambach <mkrambach@intevation.de>
date Tue, 07 Feb 2017 19:50:36 +0100
parents 195c5d9b234b
children b58868c47f02
comparison
equal deleted inserted replaced
1360:d1dce50fa9a6 1361:5c2d6812d85a
87 expand: function() { 87 expand: function() {
88 this.map.addControl(new OpenLayers.Control.ScaleLine()); 88 this.map.addControl(new OpenLayers.Control.ScaleLine());
89 } 89 }
90 } 90 }
91 }]; 91 }];
92
93 this.callParent(arguments); 92 this.callParent(arguments);
93 var map = this.down('map');
94 var osg = this.down('ortstammdatengrid');
95 osg.setLoading(true);
96 map.setLoading(true);
97 this.setStore();
94 }, 98 },
95 99
96 afterRender: function() { 100 afterRender: function() {
97 this.superclass.afterRender.apply(this, arguments); 101 this.superclass.afterRender.apply(this, arguments);
98 this.down('map').map.zoomTo(6); 102 this.down('map').map.zoomTo(6);
100 104
101 setStore: function(store) { 105 setStore: function(store) {
102 var me = this; 106 var me = this;
103 var osg = this.down('ortstammdatengrid'); 107 var osg = this.down('ortstammdatengrid');
104 var map = this.down('map'); 108 var map = this.down('map');
109 osg.setLoading(true);
110 map.setLoading(true);
105 111
106 if (!store) { 112 if (!store) {
107 var ortstore = Ext.create('Lada.store.Orte', { 113 this.ortstore = Ext.data.StoreManager.get('orte');
108 defaultPageSize: 0, 114 //this.ortstore.clearFilter(true);
109 listeners: { 115 } else {
110 beforeload: { 116 this.ortstore = store;
111 fn: function() {
112 osg.setLoading(true);
113 map.setLoading(true);
114 }
115 },
116 load: {
117 fn: function() {
118 osg.setLoading(false);
119 map.setLoading(false);
120 osg.setStore(ortstore);
121 map.addLocations(ortstore);
122 }
123 }
124 }
125 });
126 } 117 }
127 else { 118 // store.clearFilter(true);
128 store.clearFilter(true); 119 this.ortstore.load({
129 osg.setStore(store); 120 callback: function() {
130 map.addLocations(store); 121 osg.setStore(me.ortstore);
131 } 122 map.addLocations(me.ortstore);
123 osg.setLoading(false);
124 map.setLoading(false);
125 }
126 });
127 //enable buttons
128 this.down('toolbar button[action=add]').enable();
129 this.down('toolbar button[action=addMap]').enable();
132 this.connectListeners(); 130 this.connectListeners();
133 //enable buttons
134 me.down('toolbar button[action=add]').enable();
135 me.down('toolbar button[action=addMap]').enable();
136 }, 131 },
137 132
138 getStore: function() { 133 getStore: function() {
139 return this.down('grid').getStore(); 134 return this.ortstore;
140 }, 135 },
141 136
142 connectListeners: function() { 137 connectListeners: function() {
143 var osg = this.down('ortstammdatengrid'); 138 var osg = this.down('ortstammdatengrid');
144 var map = this.down('map'); 139 var map = this.down('map');

http://lada.wald.intevation.org