Mercurial > lada > lada-client
changeset 864:77e68fae3772
merged.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 10 Jul 2015 18:24:44 +0200 |
parents | 40f0450799ec (current diff) 1830ed929367 (diff) |
children | 7bd3afe30ac2 |
files | |
diffstat | 4 files changed, 61 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/app/controller/FilterResult.js Fri Jul 10 18:24:18 2015 +0200 +++ b/app/controller/FilterResult.js Fri Jul 10 18:24:44 2015 +0200 @@ -34,6 +34,9 @@ 'filterresultgrid toolbar button[action=addMessprogramm]': { click: this.addMessprogrammItem }, + 'filterresultgrid toolbar button[action=genProbenFromMessprogramm]': { + click: this.genProbenFromMessprogramm + }, 'filterresultgrid toolbar button[action=import]': { click: this.uploadFile }, @@ -101,6 +104,46 @@ }, /** + * This button creates a window to generate Proben + * from a selected messprogramm. + */ + genProbenFromMessprogramm: function(button) { + var grid = button.up('grid'); + var selection = grid.getView().getSelectionModel().getSelection(); + var i18n = Lada.getApplication().bundle; + var proben = []; + for (var i = 0; i < selection.length; i++) { + proben.push(selection[i].get('id')); + } + var me = this; + + var winname = 'Lada.view.window.GenProbenFromMessprogramm'; + for (p in proben) { + grid.setLoading(true); + Ext.ClassManager.get('Lada.model.Messprogramm').load(proben[p], { + failure: function(record, action) { + me.setLoading(false); + // TODO + console.log('An unhandled Failure occured. See following Response and Record'); + console.log(action); + console.log(record); + }, + success: function(record, response) { + grid.setLoading(false); + + var win = Ext.create(winname, { + record: record, + parentWindow: null + }); + win.show(); + win.initData(); + }, + scope: this + }); + } + }, + + /** * This function opens a {@link Lada.view.window.FileUpload} * window to upload a LAF-File */
--- a/app/view/grid/FilterResult.js Fri Jul 10 18:24:18 2015 +0200 +++ b/app/view/grid/FilterResult.js Fri Jul 10 18:24:44 2015 +0200 @@ -42,13 +42,6 @@ action: 'addProbe', disabled: false }, { - text: 'Messprogramm erstellen', - icon: 'resources/img/list-add.png', - action: 'addMessprogramm', - disabled: true - }, - '-', - { text: 'Proben Importieren', icon: 'resources/img/svn-commit.png', action: 'import', @@ -58,8 +51,19 @@ icon: 'resources/img/svn-update.png', action: 'export', disabled: true - } - ] + }, + '-', + { + text: 'Messprogramm erstellen', + icon: 'resources/img/list-add.png', + action: 'addMessprogramm', + disabled: true + }, { + text: 'Proben generieren', + icon: 'resources/img/view-time-schedule-insert.png', + action: 'genProbenFromMessprogramm', + disabled: true + }] }]; this.columns = []; this.callParent(arguments); @@ -94,6 +98,7 @@ if (store.model.modelName == 'Lada.model.ProbeList'){ t.setText(i18n.getMsg('probelist')); this.down('button[action=addMessprogramm]').disable(); + this.down('button[action=genProbenFromMessprogramm]').disable(); this.down('button[action=addProbe]').enable(); this.down('button[action=import]').enable(); this.down('button[action=export]').enable(); @@ -101,6 +106,7 @@ else if (store.model.modelName == 'Lada.model.MessprogrammList') { t.setText(i18n.getMsg('probeplanning')); this.down('button[action=addMessprogramm]').enable(); + this.down('button[action=genProbenFromMessprogramm]').enable(); this.down('button[action=addProbe]').disable(); this.down('button[action=import]').disable(); this.down('button[action=export]').disable();
--- a/app/view/window/GenProbenFromMessprogramm.js Fri Jul 10 18:24:18 2015 +0200 +++ b/app/view/window/GenProbenFromMessprogramm.js Fri Jul 10 18:24:44 2015 +0200 @@ -125,7 +125,9 @@ this.getEl().addCls('window-inactive'); }, close: function () { - this.parentWindow.probenWindow = null; + if (this.parentWindow) { + this.parentWindow.probenWindow = null; + } } });