annotate app/view/window/ProbeCreate.js @ 812:188a9faf96e0

Added Errorhandling for AJAX-Requests, especially Authentication Issues.
author Dustin Demuth <dustin@intevation.de>
date Wed, 27 May 2015 16:59:23 +0200
parents 6f6d2df00130
children d9824c49e781
rev   line source
619
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9 /*
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 * Window to edit a Probe
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 */
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.window.ProbeCreate', {
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Ext.window.Window',
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 alias: 'widget.probecreate',
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 requires: [
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 'Lada.view.form.Probe'
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 ],
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 collapsible: true,
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21 maximizable: true,
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 autoShow: true,
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 autoScroll: true,
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 layout: 'fit',
688
6a6d1b02a1a3 constrain windows to viewport
Dustin Demuth <dustin@intevation.de>
parents: 619
diff changeset
25 constrain: true,
619
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 record: null,
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 initComponent: function() {
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 this.title = '§3-Probe';
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 this.buttons = [{
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32 text: 'Schließen',
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 scope: this,
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34 handler: this.close
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 }];
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
36
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
37 // 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
38 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
39 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
40 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
41 },
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
42 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
43 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
44 }
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
45 });
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
46
619
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 this.width = 700;
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 // InitialConfig is the config object passed to the constructor on
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 // creation of this window. We need to pass it throuh to the form as
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 // we need the "modelId" param to load the correct item.
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 this.items = [{
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 border: 0,
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 autoScroll: true,
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 items: [{
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 xtype: 'probeform'
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 }]
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 }];
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 this.callParent(arguments);
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 },
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 initData: function() {
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 var record = Ext.create('Lada.model.Probe');
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 this.down('probeform').setRecord(record);
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 },
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 setMessages: function(errors, warnings) {
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 this.down('probeform').setMessages(errors, warnings);
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 },
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 clearMessages: function() {
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 this.down('probeform').clearMessages();
707
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
73 },
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
74
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
75 disableChildren: function(){
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
76 //intentionally!
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
77 return true;
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
78 },
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
79
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
80 enableChildren: function(){
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
81 //intentionally!
c632c7c34029 added disable/enableChildren Method
Dustin Demuth <dustin@intevation.de>
parents: 688
diff changeset
82 return true;
619
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 }
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 });

http://lada.wald.intevation.org