comparison app/view/window/Messprogramm.js @ 818:097d4edc2f00

Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
author Dustin Demuth <dustin@intevation.de>
date Fri, 29 May 2015 09:05:06 +0200
parents f0b26df02157
children 6249b731d438
comparison
equal deleted inserted replaced
817:1321efe444f0 818:097d4edc2f00
23 maximizable: true, 23 maximizable: true,
24 autoShow: true, 24 autoShow: true,
25 autoScroll: true, 25 autoScroll: true,
26 layout: 'fit', 26 layout: 'fit',
27 constrain: true, 27 constrain: true,
28 probenWindow: null,
28 29
29 record: null, 30 record: null,
30 31
31 initComponent: function() { 32 initComponent: function() {
32 var i18n = Lada.getApplication().bundle; 33 var i18n = Lada.getApplication().bundle;
35 this.title = i18n.getMsg('messprogramm.window.create.title'); 36 this.title = i18n.getMsg('messprogramm.window.create.title');
36 } 37 }
37 else { 38 else {
38 this.title = i18n.getMsg('messprogramm.window.edit.title'); 39 this.title = i18n.getMsg('messprogramm.window.edit.title');
39 } 40 }
40
41 this.buttons = [{ 41 this.buttons = [{
42 text: i18n.getMsg('generateproben'), 42 text: i18n.getMsg('generateproben'),
43 scope: this, 43 scope: this,
44 disabled: this.record? false : true, //disable button if no record is set. 44 disabled: this.record? false : true, //disable button if no record is set.
45 handler: function() { 45 handler: function() {
46 var winname = 'Lada.view.window.GenProbenFromMessprogramm'; 46 //Make the Window a "singleton"
47 var win = Ext.create(winname, { 47 if (! this.probenWindow) {
48 record: this.record 48 var winname = 'Lada.view.window.GenProbenFromMessprogramm';
49 }); 49 var win = Ext.create(winname, {
50 win.show(); 50 record: this.record,
51 win.initData(); 51 parentWindow: this
52 });
53 win.show();
54 win.initData();
55 this.probenWindow = win;
56 }
57 else {
58 this.probenWindow.focus();
59 this.probenWindow.setActive(true);
60 }
52 } 61 }
53 }, 62 },
54 '->', 63 '->',
55 { 64 {
56 text: i18n.getMsg('close'), 65 text: i18n.getMsg('close'),

http://lada.wald.intevation.org