annotate app/view/window/MessungEdit.js @ 709:6f6d2df00130

Added some CSS to make distinction between active and inactice windows more simple for the user
author Dustin Demuth <dustin@intevation.de>
date Tue, 07 Apr 2015 17:16:59 +0200
parents c632c7c34029
children f204f30b824a
rev   line source
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
3 *
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
7 */
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
8
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
9 /*
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
10 * Window to edit a Messung
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
11 */
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.window.MessungEdit', {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
13 extend: 'Ext.window.Window',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
14 alias: 'widget.messungedit',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
15
581
424802824648 Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents: 576
diff changeset
16 requires: [
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
17 'Lada.view.form.Messung',
595
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
18 'Lada.view.grid.Messwert',
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
19 'Lada.view.grid.Status',
597
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
20 'Lada.view.grid.MKommentar'
581
424802824648 Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents: 576
diff changeset
21 ],
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
22
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
23 collapsible: true,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
24 maximizable: true,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
25 autoshow: true,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
26 autoscroll: true,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
27 layout: 'fit',
688
6a6d1b02a1a3 constrain windows to viewport
Dustin Demuth <dustin@intevation.de>
parents: 687
diff changeset
28 constrain: true,
690
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
29
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
30 probe: null,
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
31 parentWindow: null,
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
32 record: null,
644
71e8b84d7829 Reload grids on messung or ort changed/added.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 613
diff changeset
33 grid: null,
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
34
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
35 initComponent: function() {
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
36 if (this.record === null) {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
37 Ext.Msg.alert('Keine valide Messung ausgewählt!');
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
38 this.callParent(arguments);
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
39 return;
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
40 }
690
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
41 if (this.probe === null) {
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
42 Ext.Msg.alert('Zu der Messung existiert keine Probe!');
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
43 this.callParent(arguments);
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
44 return;
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
45 }
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
46 this.title = 'Messung ' + this.record.get('nebenprobenNr');
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
47 this.buttons = [{
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
48 text: 'Schließen',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
49 scope: this,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
50 handler: this.close
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
51 }];
709
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 707
diff changeset
52
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 707
diff changeset
53 // add listeners to change the window appearence when it becomes inactive
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 707
diff changeset
54 this.on({
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 707
diff changeset
55 activate: function(){
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 707
diff changeset
56 this.getEl().removeCls('window-inactive');
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 707
diff changeset
57 },
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 707
diff changeset
58 deactivate: function(){
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 707
diff changeset
59 this.getEl().addCls('window-inactive');
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 707
diff changeset
60 }
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 707
diff changeset
61 });
6f6d2df00130 Added some CSS to make distinction between active and inactice windows more simple for the user
Dustin Demuth <dustin@intevation.de>
parents: 707
diff changeset
62
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
63 this.width = 700;
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
64 this.height = Ext.getBody().getViewSize().height - 30;
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
65
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
66 this.items = [{
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
67 border: 0,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
68 autoScroll: true,
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
69 items: [{
581
424802824648 Added a form for Messungen (unfinished)
Dustin Demuth <dustin@intevation.de>
parents: 576
diff changeset
70 xtype: 'messungform',
611
8a156a7fbe67 added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents: 597
diff changeset
71 margin: 5,
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
72 recordId: this.record.get('id')
613
f959205ab173 reverted changes on messungenedit.js
Dustin Demuth <dustin@intevation.de>
parents: 611
diff changeset
73 }, {
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
74 xtype: 'fset',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
75 name: 'messwerte',
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
76 title: 'Messwerte',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
77 padding: '5, 5',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
78 margin: 5,
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
79 items: [{
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
80 xtype: 'messwertgrid',
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
81 recordId: this.record.get('id')
613
f959205ab173 reverted changes on messungenedit.js
Dustin Demuth <dustin@intevation.de>
parents: 611
diff changeset
82 }]
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
83 }, {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
84 xtype: 'fset',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
85 name: 'messungstatus',
595
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
86 title: 'Status',
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
87 padding: '5, 5',
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
88 margin: 5,
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
89 items: [{
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
90 xtype: 'statusgrid',
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
91 recordId: this.record.get('id')
a81dafe06d1d Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 590
diff changeset
92 }]
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
93 }, {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
94 xtype: 'fset',
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
95 name: 'messungskommentare',
597
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
96 title: 'Kommentare',
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
97 padding: '5, 5',
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
98 margin: 5,
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
99 items: [{
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
100 xtype: 'mkommentargrid',
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
101 recordId: this.record.get('id')
d2ce1c4c3aad Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 595
diff changeset
102 }]
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
103 }]
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
104 }];
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
105 this.callParent(arguments);
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
106 },
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
107
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
108 initData: function() {
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
109 this.clearMessages();
693
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
110 var that = this;
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
111 Ext.ClassManager.get('Lada.model.Messung').load(this.record.get('id'), {
696
b0f1dcdf981d Made the unhandled Errors more talkativew
Dustin Demuth <dustin@intevation.de>
parents: 693
diff changeset
112 failure: function(record, response) {
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
113 // TODO
696
b0f1dcdf981d Made the unhandled Errors more talkativew
Dustin Demuth <dustin@intevation.de>
parents: 693
diff changeset
114 console.log("An unhandled Failure occured. See following Response and Record");
b0f1dcdf981d Made the unhandled Errors more talkativew
Dustin Demuth <dustin@intevation.de>
parents: 693
diff changeset
115 console.log(response);
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
116 console.log(record);
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
117 },
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
118 success: function(record, response) {
690
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
119 var me = this;
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
120 if (this.probe.get('treeModified') < record.get('treeModified')) {
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
121 Ext.Msg.show({
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
122 title: 'Probe nicht aktuell!',
696
b0f1dcdf981d Made the unhandled Errors more talkativew
Dustin Demuth <dustin@intevation.de>
parents: 693
diff changeset
123 msg: 'Die zugehörige Probe wurde verändert.\n'+
b0f1dcdf981d Made the unhandled Errors more talkativew
Dustin Demuth <dustin@intevation.de>
parents: 693
diff changeset
124 'Möchten Sie zu der Probe zurückkehren und neu laden?\n'+
b0f1dcdf981d Made the unhandled Errors more talkativew
Dustin Demuth <dustin@intevation.de>
parents: 693
diff changeset
125 'Ohne das erneute Laden der Probe wird das Speichern'+
b0f1dcdf981d Made the unhandled Errors more talkativew
Dustin Demuth <dustin@intevation.de>
parents: 693
diff changeset
126 ' der Messung nicht möglich sein.',
690
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
127 buttons: Ext.Msg.OKCANCEL,
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
128 icon: Ext.Msg.WARNING,
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
129 closable: false,
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
130 fn: function(button) {
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
131 if (button === 'ok') {
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
132 me.close();
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
133 me.parentWindow.initData();
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
134 }
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
135 else {
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
136 me.record.set('treeModified', me.probe.get('treeModified'));
693
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
137 that.disableForm();
690
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
138 }
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
139 }
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
140 });
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
141 }
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
142 this.down('messungform').setRecord(record);
690
e88381fb3bdb Use treeModiefied timestamp to determine if working with 'old' objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 688
diff changeset
143 this.record = record;
590
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
144 var json = Ext.decode(response.response.responseText);
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
145 if (json) {
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
146 this.setMessages(json.errors, json.warnings);
e440b66a859f Added grid (+controller) for messwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 581
diff changeset
147 }
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
148 },
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
149 scope: this
611
8a156a7fbe67 added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents: 597
diff changeset
150 });
693
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
151 if (this.record.get('readonly') == true){
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
152 this.disableForm();
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
153 }
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
154 },
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
155
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
156 disableForm: function(){
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
157 this.down('messungform').setReadOnly(true);
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
158 this.disableChildren();
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
159 },
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
160
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
161 enableForm: function(){
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
162 this.down('messungform').setReadOnly(false);
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
163 this.enableChildren();
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
164 },
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
165
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
166 disableChildren: function(){
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
167 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(true);
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
168 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(true);
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
169 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(true);
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
170 },
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
171
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
172 enableChildren: function(){
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
173 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(false);
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
174 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(false);
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 690
diff changeset
175 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(false);
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
176 },
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
177
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
178 setMessages: function(errors, warnings) {
707
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 696
diff changeset
179 this.down('messungform').setMessages(errors, warnings);
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
180 },
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
181 clearMessages: function() {
707
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 696
diff changeset
182 this.down('messungform').clearMessages();
576
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
183 }
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
184
0d4137e0fe36 Added a blank window to edit a Messung
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
185 });

http://lada.wald.intevation.org