annotate app/controller/form/Messung.js @ 1367:d2a0cb1e5596

fix validity of oz-Id in Ortserstellung
author Maximilian Krambach <mkrambach@intevation.de>
date Wed, 08 Feb 2017 15:46:58 +0100
parents 81b585645581
children 7e9a6f0e55b3
rev   line source
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:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
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:
diff changeset
2 * Software engineering by Intevation GmbH
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:
diff changeset
3 *
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:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
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:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
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:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
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:
diff changeset
7 */
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:
diff changeset
8
742
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
9 /**
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
10 * This is a controller for a Messung form
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
11 */
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:
diff changeset
12 Ext.define('Lada.controller.form.Messung', {
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:
diff changeset
13 extend: 'Ext.app.Controller',
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:
diff changeset
14
742
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
15 /**
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
16 * Initialize the Controller
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
17 * It has 3 listeners
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
18 */
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:
diff changeset
19 init: function() {
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:
diff changeset
20 this.control({
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:
diff changeset
21 'messungform button[action=save]': {
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:
diff changeset
22 click: this.save
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:
diff changeset
23 },
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:
diff changeset
24 'messungform button[action=discard]': {
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:
diff changeset
25 click: this.discard
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:
diff changeset
26 },
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:
diff changeset
27 'messungform': {
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:
diff changeset
28 dirtychange: this.dirtyForm
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:
diff changeset
29 }
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:
diff changeset
30 });
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:
diff changeset
31 },
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:
diff changeset
32
742
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
33 /**
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
34 * The save function saves the content of the Location form.
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
35 * On success it will reload the Store,
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
36 * on failure, it will display an Errormessage
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
37 */
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:
diff changeset
38 save: function(button) {
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:
diff changeset
39 var formPanel = button.up('form');
713
2e478b3a587a Set some loading masks.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 712
diff changeset
40 formPanel.setLoading(true);
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:
diff changeset
41 var data = formPanel.getForm().getFieldValues(true);
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:
diff changeset
42 for (var key in data) {
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:
diff changeset
43 formPanel.getForm().getRecord().set(key, data[key]);
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:
diff changeset
44 }
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:
diff changeset
45 formPanel.getForm().getRecord().save({
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:
diff changeset
46 success: function(record, response) {
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:
diff changeset
47 var json = Ext.decode(response.response.responseText);
622
ee92e352be20 Open messung create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 611
diff changeset
48 if (json) {
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:
diff changeset
49 button.setDisabled(true);
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:
diff changeset
50 button.up('toolbar').down('button[action=discard]')
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:
diff changeset
51 .setDisabled(true);
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:
diff changeset
52 formPanel.clearMessages();
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:
diff changeset
53 formPanel.setRecord(record);
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:
diff changeset
54 formPanel.setMessages(json.errors, json.warnings);
710
f204f30b824a Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 701
diff changeset
55 formPanel.up('window').initData();
644
71e8b84d7829 Reload grids on messung or ort changed/added.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 639
diff changeset
56 formPanel.up('window').grid.store.reload();
1120
0a032c98c3a6 Use correct parent window reference for messung windows.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 972
diff changeset
57 var parentWin = button.up('window').parentWindow;
710
f204f30b824a Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 701
diff changeset
58 parentWin.initData();
639
fdaabab6f4cc Open Probe-/Messung-Edit window automatically if a new item was saved
Raimund Renkert <raimund.renkert@intevation.de>
parents: 622
diff changeset
59 if (response.action === 'create' && json.success) {
710
f204f30b824a Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 701
diff changeset
60 var oldWin = button.up('window');
f204f30b824a Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 701
diff changeset
61 var probe = oldWin.record;
f204f30b824a Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 701
diff changeset
62 oldWin.close();
639
fdaabab6f4cc Open Probe-/Messung-Edit window automatically if a new item was saved
Raimund Renkert <raimund.renkert@intevation.de>
parents: 622
diff changeset
63 var win = Ext.create('Lada.view.window.MessungEdit', {
710
f204f30b824a Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 701
diff changeset
64 probe: probe,
f204f30b824a Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 701
diff changeset
65 parentWindow: parentWin,
f204f30b824a Handle readonly mode and refresh operations.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 701
diff changeset
66 grid: oldWin.grid,
639
fdaabab6f4cc Open Probe-/Messung-Edit window automatically if a new item was saved
Raimund Renkert <raimund.renkert@intevation.de>
parents: 622
diff changeset
67 record: record
fdaabab6f4cc Open Probe-/Messung-Edit window automatically if a new item was saved
Raimund Renkert <raimund.renkert@intevation.de>
parents: 622
diff changeset
68 });
fdaabab6f4cc Open Probe-/Messung-Edit window automatically if a new item was saved
Raimund Renkert <raimund.renkert@intevation.de>
parents: 622
diff changeset
69 win.show();
fdaabab6f4cc Open Probe-/Messung-Edit window automatically if a new item was saved
Raimund Renkert <raimund.renkert@intevation.de>
parents: 622
diff changeset
70 win.initData();
fdaabab6f4cc Open Probe-/Messung-Edit window automatically if a new item was saved
Raimund Renkert <raimund.renkert@intevation.de>
parents: 622
diff changeset
71 }
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:
diff changeset
72 }
713
2e478b3a587a Set some loading masks.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 712
diff changeset
73 formPanel.setLoading(false);
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:
diff changeset
74 },
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:
diff changeset
75 failure: function(record, response) {
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:
diff changeset
76 button.setDisabled(true);
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:
diff changeset
77 button.up('toolbar').down('button[action=discard]')
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:
diff changeset
78 .setDisabled(true);
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:
diff changeset
79 formPanel.getForm().loadRecord(formPanel.getForm().getRecord());
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:
diff changeset
80 var json = response.request.scope.reader.jsonData;
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:
diff changeset
81 if (json) {
712
baef70abfe71 Cosmetics.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 710
diff changeset
82 if (json.message) {
701
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 695
diff changeset
83 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title')
712
baef70abfe71 Cosmetics.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 710
diff changeset
84 + ' #' + json.message,
695
d6ef146e1a9f Added simple handling for Failure-Messages
Dustin Demuth <dustin@intevation.de>
parents: 693
diff changeset
85 Lada.getApplication().bundle.getMsg(json.message));
712
baef70abfe71 Cosmetics.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 710
diff changeset
86 }
baef70abfe71 Cosmetics.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 710
diff changeset
87 else {
701
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 695
diff changeset
88 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 695
diff changeset
89 Lada.getApplication().bundle.getMsg('err.msg.generic.body'));
693
817524db4017 Readonly was missing
Dustin Demuth <dustin@intevation.de>
parents: 687
diff changeset
90 }
720
c2a6f7caa71b Fix for ErrorMessages in FieldSets for IE8 IE9
Dustin Demuth <dustin@intevation.de>
parents: 715
diff changeset
91 formPanel.clearMessages();
c2a6f7caa71b Fix for ErrorMessages in FieldSets for IE8 IE9
Dustin Demuth <dustin@intevation.de>
parents: 715
diff changeset
92 formPanel.setRecord(record);
c2a6f7caa71b Fix for ErrorMessages in FieldSets for IE8 IE9
Dustin Demuth <dustin@intevation.de>
parents: 715
diff changeset
93 formPanel.setMessages(json.errors, json.warnings);
c2a6f7caa71b Fix for ErrorMessages in FieldSets for IE8 IE9
Dustin Demuth <dustin@intevation.de>
parents: 715
diff changeset
94 formPanel.up('window').initData();
c2a6f7caa71b Fix for ErrorMessages in FieldSets for IE8 IE9
Dustin Demuth <dustin@intevation.de>
parents: 715
diff changeset
95 formPanel.up('window').grid.store.reload();
c2a6f7caa71b Fix for ErrorMessages in FieldSets for IE8 IE9
Dustin Demuth <dustin@intevation.de>
parents: 715
diff changeset
96 }
712
baef70abfe71 Cosmetics.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 710
diff changeset
97 else {
701
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 695
diff changeset
98 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
f0bc5387abcc Added failure - Messages
Dustin Demuth <dustin@intevation.de>
parents: 695
diff changeset
99 Lada.getApplication().bundle.getMsg('err.msg.response.body'));
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:
diff changeset
100 }
713
2e478b3a587a Set some loading masks.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 712
diff changeset
101 formPanel.setLoading(false);
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:
diff changeset
102 }
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:
diff changeset
103 });
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:
diff changeset
104 },
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:
diff changeset
105
742
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
106 /**
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
107 * The discard function resets the Location form
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
108 * to its original state.
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
109 */
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
110 discard: function(button) {
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:
diff changeset
111 var formPanel = button.up('form');
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:
diff changeset
112 formPanel.getForm().loadRecord(formPanel.getForm().getRecord());
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:
diff changeset
113 },
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:
diff changeset
114
742
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
115 /**
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
116 * The dirtyForm function enables or disables the save and discard
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
117 * button which are present in the toolbar of the form.
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
118 * The Buttons are only active if the content of the form was altered
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
119 * (the form is dirty).
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
120 * In Additon it calls the disableChildren() function of the window
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
121 * embedding the form. Only when the record does not carry the readonly
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
122 * flag, the function calls the embedding windows enableChilren() function
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
123 */
6e28ebbe1a73 added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents: 720
diff changeset
124 dirtyForm: function(form, dirty) {
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:
diff changeset
125 if (dirty) {
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:
diff changeset
126 form.owner.down('button[action=save]').setDisabled(false);
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:
diff changeset
127 form.owner.down('button[action=discard]').setDisabled(false);
687
aedf0709af92 Applied ReadOnlyParadigm to a Messung Window
Dustin Demuth <dustin@intevation.de>
parents: 644
diff changeset
128 form.owner.up('window').disableChildren();
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:
diff changeset
129 }
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:
diff changeset
130 else {
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:
diff changeset
131 form.owner.down('button[action=save]').setDisabled(true);
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:
diff changeset
132 form.owner.down('button[action=discard]').setDisabled(true);
715
605bc34b45a0 Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
Dustin Demuth <dustin@intevation.de>
parents: 713
diff changeset
133 //Only enable children if the form was not readOnly
605bc34b45a0 Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
Dustin Demuth <dustin@intevation.de>
parents: 713
diff changeset
134 if (!form.getRecord().get('readonly')) {
605bc34b45a0 Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
Dustin Demuth <dustin@intevation.de>
parents: 713
diff changeset
135 form.owner.up('window').enableChildren();
605bc34b45a0 Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
Dustin Demuth <dustin@intevation.de>
parents: 713
diff changeset
136 }
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:
diff changeset
137 }
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:
diff changeset
138 }
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:
diff changeset
139 });

http://lada.wald.intevation.org