Mercurial > lada > lada-client
comparison app/controller/ProbenPlanungSwitcher.js @ 792:d572ee3271ac
some work on a context-sensitive toolbar
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Wed, 13 May 2015 13:00:13 +0200 |
parents | 639e82e2089e |
children | bc6bc71efb78 |
comparison
equal
deleted
inserted
replaced
791:56f91254cd23 | 792:d572ee3271ac |
---|---|
24 * A checked PPS-Radiofield fired a 'check'-event | 24 * A checked PPS-Radiofield fired a 'check'-event |
25 */ | 25 */ |
26 init: function() { | 26 init: function() { |
27 this.control({ | 27 this.control({ |
28 'radiofield[name=ppswitch]': { | 28 'radiofield[name=ppswitch]': { |
29 check: this.switchStores | 29 check: this.switchModes |
30 } | 30 } |
31 }); | 31 }); |
32 this.callParent(arguments); | 32 this.callParent(arguments); |
33 }, | 33 }, |
34 | 34 |
35 /** | 35 /** |
36 * Function is called when the user selects a checkbox. | 36 * Function is called when the user selects a checkbox. |
37 * according to the checkboxes inputValue, | 37 * according to the checkboxes inputValue, |
38 * the function alters the store which was loaded by the | 38 * the function alters the store which was loaded by the |
39 * filterpanels combobox | 39 * filterpanels combobox, |
40 * If enabled the function also disables / enables the UI-Buttons | |
41 * in the Filterresult grid. | |
40 */ | 42 */ |
41 switchStores: function(field) { | 43 switchModes: function(field) { |
44 | |
45 var disableButtons = true; | |
46 | |
42 var cbox = field.up('probenplanungswitcher').up().down('combobox'); | 47 var cbox = field.up('probenplanungswitcher').up().down('combobox'); |
43 var resultGrid = field.up('panel[name=main]').down('filterresultgrid'); | 48 var resultGrid = field.up('panel[name=main]').down('filterresultgrid'); |
44 filters = field.up('panel[name=main]').down('fieldset[name=filtervariables]'); | 49 filters = field.up('panel[name=main]').down('fieldset[name=filtervariables]'); |
45 filters.removeAll(); | 50 filters.removeAll(); |
46 filters.hide(); | 51 filters.hide(); |
47 var sname = 'Lada.store.ProbeQueries'; | 52 var sname = 'Lada.store.ProbeQueries'; |
48 if (field.inputValue === 'MessprogrammeList' && cbox) { | 53 if (field.inputValue === 'MessprogrammList' && cbox) { |
49 sname = 'Lada.store.MessprogrammQueries'; | 54 sname = 'Lada.store.MessprogrammQueries'; |
50 } | 55 } |
51 else if (field.inputValue === 'ProbenList' && cbox) { | 56 else if (field.inputValue === 'ProbeList' && cbox) { |
52 sname = 'Lada.store.ProbeQueries'; | 57 sname = 'Lada.store.ProbeQueries'; |
53 } | 58 } |
59 | |
54 | 60 |
55 var store = Ext.StoreManager.lookup(sname); | 61 var store = Ext.StoreManager.lookup(sname); |
56 if (!store) { | 62 if (!store) { |
57 store = Ext.create(sname); | 63 store = Ext.create(sname); |
58 } | 64 } |