annotate app/view/window/ProbeCreate.js @ 688:6a6d1b02a1a3

constrain windows to viewport
author Dustin Demuth <dustin@intevation.de>
date Wed, 25 Mar 2015 15:59:45 +0100
parents 7a7a16b0a548
children c632c7c34029
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 }];
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 this.width = 700;
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 // 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
38 // 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
39 // 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
40
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 this.items = [{
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 border: 0,
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 autoScroll: true,
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 items: [{
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 xtype: 'probeform'
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 }]
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 }];
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 this.callParent(arguments);
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 },
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 initData: function() {
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 var record = Ext.create('Lada.model.Probe');
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 this.down('probeform').setRecord(record);
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 },
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 setMessages: function(errors, warnings) {
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 this.down('probeform').setMessages(errors, warnings);
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
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 clearMessages: function() {
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 this.down('probeform').clearMessages();
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 }
7a7a16b0a548 Added window for creating probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 });

http://lada.wald.intevation.org