Mercurial > lada > lada-client
diff app/controller/ProbenPlanungSwitcher.js @ 837:d054732bc7a2
Switch the Mode of the Filterresultgrid according to the selection of the radio buttons in the probenplanungswitcher
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Mon, 06 Jul 2015 16:43:08 +0200 |
parents | 255568e97c96 |
children | 96e04c258b8f |
line wrap: on
line diff
--- a/app/controller/ProbenPlanungSwitcher.js Mon Jul 06 10:45:25 2015 +0200 +++ b/app/controller/ProbenPlanungSwitcher.js Mon Jul 06 16:43:08 2015 +0200 @@ -43,22 +43,25 @@ switchModes: function(field) { var disableButtons = true; - var cbox = field.up('probenplanungswitcher').up().down('combobox'); var resultGrid = field.up('panel[name=main]').down('filterresultgrid'); filters = field.up('panel[name=main]').down('fieldset[name=filtervariables]'); filters.removeAll(); filters.hide(); var sname = 'Lada.store.ProbeQueries'; + var gridsname = 'Lada.store.ProbenList'; if (field.inputValue === 'MessprogrammList' && cbox) { sname = 'Lada.store.MessprogrammQueries'; + gridsname = 'Lada.store.MessprogrammeList'; } else if (field.inputValue === 'ProbeList' && cbox) { sname = 'Lada.store.ProbeQueries'; + gridsname = 'Lada.store.ProbenList'; } var store = Ext.StoreManager.lookup(sname); + if (!store) { store = Ext.create(sname, { //Select first Item on Load @@ -78,5 +81,17 @@ cbox.reset(); cbox.bindStore(store); } + + var gridstore = Ext.StoreManager.lookup(gridsname); + if (!gridstore) { + gridstore = Ext.create(gridsname); + } + if (gridstore) { + gridstore.addListener('beforeload', this.loadingAnimationOn, resultGrid); + gridstore.addListener('load', this.loadingAnimationOff, resultGrid); + resultGrid.setStore(gridstore); + resultGrid.show(); + } + } });