Mercurial > lada > lada-client
changeset 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 | 6de96799746f |
children | bbbccdb103cf |
files | app/controller/ProbenPlanungSwitcher.js app/view/grid/FilterResult.js |
diffstat | 2 files changed, 20 insertions(+), 3 deletions(-) [+] |
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(); + } + } });
--- a/app/view/grid/FilterResult.js Mon Jul 06 10:45:25 2015 +0200 +++ b/app/view/grid/FilterResult.js Mon Jul 06 16:43:08 2015 +0200 @@ -23,13 +23,15 @@ }, initComponent: function() { + var i18n = Lada.getApplication().bundle; + this.dockedItems = [{ xtype: 'toolbar', dock: 'top', items: [{ xtype: 'tbtext', id: 'tbtitle', - text: '', + text: i18n.getMsg('probelist') }, '->', { @@ -41,7 +43,7 @@ text: 'Messprogramm erstellen', icon: 'resources/img/list-add.png', action: 'addMessprogramm', - disabled: false + disabled: true }, '-', {