comparison app/controller/ModeSwitcher.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 7f5219b8e1bf
children d6e259e76de6
comparison
equal deleted inserted replaced
1010:94a6b5415d73 1015:af9879d72310
44 var cbox = field.up('modeswitcher').up().down('combobox'); 44 var cbox = field.up('modeswitcher').up().down('combobox');
45 filters = field.up('panel[name=main]').down('fieldset[name=filtervariables]'); 45 filters = field.up('panel[name=main]').down('fieldset[name=filtervariables]');
46 filters.removeAll(); 46 filters.removeAll();
47 filters.hide(); 47 filters.hide();
48 48
49 //Initialise variables which will define the querystore 49 var filterController = this.getController('Lada.controller.Filter');
50 // and the store which has to be loaded into the grid. 50 filterController.mode = field.inputValue;
51 var querystorename = ''; 51 filterController.updateFilter(cbox);
52
53 // In dependence of the checkboxes input value,
54 // define the store of the filter.
55 // app/controller/Filter.js contains similar code.
56 if (field.inputValue === 'messprogramme' && cbox) {
57 querystorename = 'Lada.store.MessprogrammQueries';
58 }
59 else if (field.inputValue === 'proben' && cbox) {
60 querystorename = 'Lada.store.ProbeQueries';
61 }
62 else if (field.inputValue === 'stammdaten' && cbox) {
63 querystorename = 'Lada.store.StammdatenQueries';
64 }
65
66 if (querystorename) {
67 var store = Ext.StoreManager.lookup(querystorename);
68
69 if (!store) {
70 store = Ext.create(querystorename, {
71 //Select first Item on Load
72 listeners: {
73 load: function(store){
74 var records = new Array();
75 records.push(store.getAt(0));
76
77 cbox.select(records[0]);
78 cbox.fireEvent('select', cbox, records);
79 }
80 }
81 });
82 }
83
84 if (store) {
85 if (!store.autoLoad) {
86 store.load();
87 }
88 //cbox.reset();
89 cbox.bindStore(store);
90 }
91 }
92 } 52 }
93 }); 53 });

http://lada.wald.intevation.org