comparison app/controller/Filter.js @ 981:2c394e72ba41 stammdatengrids

Use the lada-server for stammdatenqueries.
author Dustin Demuth <dustin@intevation.de>
date Fri, 04 Dec 2015 15:29:04 +0100
parents c6ae0aadb634
children 0a5fe163f1c8
comparison
equal deleted inserted replaced
980:7867752a0d58 981:2c394e72ba41
90 // Setup Columns 90 // Setup Columns
91 if (this.displayFields) { 91 if (this.displayFields) {
92 this.displayFields.reverse(); 92 this.displayFields.reverse();
93 } 93 }
94 94
95 /// THIS IS INTERMEDIARY CODE AND CAN BE REMOVED WHEN TYPES ARE SENT FOR PROBEN AND MESSPROGRAMME 95 if (queryType == 'probe' || queryType == 'messprogramm') {
96 console.log('remove this intermediary code...');
97 var modes = element.up('panel[name=main]').down('radiogroup').getChecked();
98 queryType = (queryType) ? queryType : modes[0].inputValue;
99 /// END OF INTERMEDIARY CODE
100
101
102 if (queryType == 'proben' || queryType == 'messprogramme') {
103 // Dynamic Grids 96 // Dynamic Grids
104 // We need to set both grid and Store. 97 // We need to set both grid and Store.
105 var frgrid; // The Resultgrid 98 var frgrid; // The Resultgrid
106 var gridstore; // The Store which will be used in the resultgrid. 99 var gridstore; // The Store which will be used in the resultgrid.
107 100
108 switch (queryType) { 101 switch (queryType) {
109 case 'proben': 102 case 'probe':
110 gridstore = Ext.create('Lada.store.ProbenList'); 103 gridstore = Ext.create('Lada.store.ProbenList');
111 frgrid = Ext.create('Lada.view.grid.ProbeList'); 104 frgrid = Ext.create('Lada.view.grid.ProbeList');
112 break; 105 break;
113 case 'messprogramme': 106 case 'messprogramm':
114 gridstore = Ext.create('Lada.store.MessprogrammeList'); 107 gridstore = Ext.create('Lada.store.MessprogrammeList');
115 frgrid = Ext.create('Lada.view.grid.MessprogrammeList'); 108 frgrid = Ext.create('Lada.view.grid.MessprogrammeList');
116 break; 109 break;
117 } 110 }
118 111
126 // Grids which are not build with dynamic columns 119 // Grids which are not build with dynamic columns
127 // The store is configured in each grid, hence we only need to set the 120 // The store is configured in each grid, hence we only need to set the
128 // grid 121 // grid
129 var resultGrid; 122 var resultGrid;
130 switch (queryType) { 123 switch (queryType) {
131 case 'MessprogrammKategorie': 124 case 'messprogrammkategorie':
132 resultGrid = Ext.create('Lada.view.grid.MessprogrammKategorie'); 125 resultGrid = Ext.create('Lada.view.grid.MessprogrammKategorie');
133 break; 126 break;
134 case 'DatensatzErzeuger': 127 case 'datensatzerzeuger':
135 resultGrid = Ext.create('Lada.view.grid.DatensatzErzeuger'); 128 resultGrid = Ext.create('Lada.view.grid.DatensatzErzeuger');
129 break;
130 case 'ort':
131 resultGrid = Ext.create('Lada.view.grid.Ort');
132 break;
133 case 'probenehmer':
134 resultGrid = Ext.create('Lada.view.grid.Probenehmer');
136 break; 135 break;
137 } 136 }
138 if (resultGrid) { 137 if (resultGrid) {
139 contentPanel.add(resultGrid); 138 contentPanel.add(resultGrid);
140 } 139 }
269 if (value instanceof Array) { 268 if (value instanceof Array) {
270 value = value.join(','); 269 value = value.join(',');
271 } 270 }
272 searchParams[filter.getName()] = value; 271 searchParams[filter.getName()] = value;
273 } 272 }
274 // Retrieve the mode 273
275 var modes = element.up('panel[name=main]').down('radiogroup').getChecked(); 274 //Store depends of the Type...
276 var sname = modes[0].inputValue; 275 // TODO the switchcasese should be unified withj those in SelectSql
277 276 switch (type) {
278 // Todo: Migragte away from sname, use type instead 277 case 'proben':
279 if (sname === 'proben') { 278 sname = 'Lada.store.ProbenList';
280 sname = 'Lada.store.ProbenList'; 279 break;
281 } 280 case 'messprogramm':
282 else if (sname === 'messprogramme') { 281 sname = 'Lada.store.MessprogrammeList';
283 sname = 'Lada.store.MessprogrammeList'; 282 break;
284 } 283 case 'messprogrammkategorie':
285 else if (sname === 'stammdaten') { 284 sname = 'Lada.store.MessprogrammKategorie';
286 //Store depends of the Type... 285 break;
287 // TODO the switchcasese should be unified 286 case 'datensatzerzeuger':
288 switch (type) { 287 sname = 'Lada.store.DatensatzErzeuger';
289 case 'MessprogrammKategorie': 288 break;
290 sname = 'Lada.store.MessprogrammKategorie'; 289 case 'ort':
291 break; 290 sname = 'Lada.store.Ort';
292 case 'DatensatzErzeuger': 291 break;
293 sname = 'Lada.store.DatensatzErzeuger'; 292 case 'probenehmer':
294 break; 293 sname = 'Lada.store.Probenehmer';
295 } 294 break;
296 } 295 }
297 296
298 // Find the store or create a new one. 297 // Find the store or create a new one.
299 var store = Ext.StoreManager.lookup(sname); 298 var store = Ext.StoreManager.lookup(sname);
300 if (!store) { 299 if (!store) {

http://lada.wald.intevation.org