comparison app/controller/Filter.js @ 1015:af9879d72310

Updated UI, added window for filter management and added fieldset for query details.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 02 Feb 2016 15:25:16 +0100
parents 9651def05ae6
children d6e259e76de6
comparison
equal deleted inserted replaced
1010:94a6b5415d73 1015:af9879d72310
13 Ext.define('Lada.controller.Filter', { 13 Ext.define('Lada.controller.Filter', {
14 extend: 'Ext.app.Controller', 14 extend: 'Ext.app.Controller',
15 15
16 requires: [ 16 requires: [
17 'Lada.view.widget.Messstelle', 17 'Lada.view.widget.Messstelle',
18 'Lada.view.window.FilterManagement',
18 'Lada.view.widget.Umwelt' 19 'Lada.view.widget.Umwelt'
19 ], 20 ],
20 21
21 stores: [ 22 stores: [
22 'ProbenList', // List of found Proben 23 'ProbenList', // List of found Proben
23 'MessprogrammeList' //List of found Messprogramme 24 'MessprogrammeList' //List of found Messprogramme
24 ], 25 ],
25 26
26 displayFields: null, 27 displayFields: null,
28
29 managementWindow: null,
30
31 mode: 'proben',
27 32
28 /** 33 /**
29 * Initialize this Controller 34 * Initialize this Controller
30 * It has 4 Listeners 35 * It has 4 Listeners
31 */ 36 */
63 * vary between orte, kategorien, ... 68 * vary between orte, kategorien, ...
64 */ 69 */
65 selectSql: function(element, record) { 70 selectSql: function(element, record) {
66 var filters = element.up('panel[name=main]').down('fieldset[name=filtervariables]'); 71 var filters = element.up('panel[name=main]').down('fieldset[name=filtervariables]');
67 72
73 if (!record[0]) {
74 return;
75 }
68 // Set "Filter Auswahl" Description 76 // Set "Filter Auswahl" Description
69 var desc = element.up('fieldset').down('displayfield[name=description]'); 77 var desc = element.up('fieldset').down('displayfield[name=description]');
70 desc.setValue(record[0].data.description); 78 desc.setValue(record[0].data.description);
71 79
72 this.displayFields = record[0].data.results; 80 this.displayFields = record[0].data.results;
73 var filterFields = record[0].data.filters; 81 var filterFields = record[0].data.filters;
74 var contentPanel = element.up('panel[name=main]').down('panel[name=contentpanel]'); 82 var contentPanel = element.up('panel[name=main]').down('panel[name=contentpanel]');
75 var queryType = record[0].get('type'); //The type of the query, might be proben, messprogramme, 83 var queryType = record[0].get('type'); //The type of the query, might be proben, messprogramme,
76 // or a stammdatendtype 84 // or a stammdatendtype
85 var details = element.up('panel[name=main]').down('filterdetails');
86 details.setRecord(record[0]);
77 87
78 this.reset(element); 88 this.reset(element);
79 89
80 contentPanel.removeAll(); //clear the panel: make space for new grids 90 contentPanel.removeAll(); //clear the panel: make space for new grids
81
82 // Set "Filter Auswahl" Columns
83 var columns = element.up('fieldset').down('displayfield[name=columns]');
84 var columnString = [];
85 for (var i = 0; i < this.displayFields.length; i++) {
86 columnString.push(this.displayFields[i].header);
87 }
88 columns.setValue(columnString.join(', '));
89 91
90 // Setup Columns 92 // Setup Columns
91 if (this.displayFields) { 93 if (this.displayFields) {
92 this.displayFields.reverse(); 94 this.displayFields.reverse();
93 } 95 }

http://lada.wald.intevation.org