Mercurial > lada > lada-client
annotate app/view/grid/Messung.js @ 1101:421db8840f49
Adapt PLZ field to data model.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 10 May 2016 17:15:30 +0200 |
parents | 0497693d5b74 |
children | a73726bba79c |
rev | line source |
---|---|
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 * |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 */ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 |
893
07dfcdf5b41f
jsduck for grids and panels
Dustin Demuth <dustin@intevation.de>
parents:
823
diff
changeset
|
9 /** |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 * Grid to list Messungen |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 */ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.grid.Messung', { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.grid.Panel', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.messunggrid', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 maxHeight: 350, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 emptyText: 'Keine Messungen gefunden', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 minHeight: 110, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 viewConfig: { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 deferEmptyText: false |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 margin: '0, 5, 5, 5', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 recordId: null, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 warnings: null, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 errors: null, |
823
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
28 readOnly: true, |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
29 allowDeselect: true, |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 initComponent: function() { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 this.dockedItems = [{ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 xtype: 'toolbar', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 dock: 'bottom', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 items: ['->', { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 text: 'Hinzufügen', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 icon: 'resources/img/list-add.png', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 action: 'add', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 probeId: this.probeId |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 }, { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 text: 'Löschen', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 icon: 'resources/img/list-remove.png', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 action: 'delete' |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 }] |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 }]; |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 this.columns = [{ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 header: 'Nebenproben-Nr.', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 dataIndex: 'nebenprobenNr', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 flex: 1, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 editor: { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 allowBlank: false |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 }, { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 header: 'MMT', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 dataIndex: 'mmtId', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 flex: 1, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 editor: { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 allowBlank: false |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 }, { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 header: 'Messzeit', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 dataIndex: 'messzeitpunkt', |
627
6742ae5f35dc
Datumsspalte xtype hinzugefügt
Dustin Demuth <dustin@intevation.de>
parents:
588
diff
changeset
|
63 xtype: 'datecolumn', |
6742ae5f35dc
Datumsspalte xtype hinzugefügt
Dustin Demuth <dustin@intevation.de>
parents:
588
diff
changeset
|
64 format: 'd.m.Y H:i', |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 flex: 2, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 editor: { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 xtype: 'datefield', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 allowBlank: false, |
627
6742ae5f35dc
Datumsspalte xtype hinzugefügt
Dustin Demuth <dustin@intevation.de>
parents:
588
diff
changeset
|
69 format: 'd.m.Y H:i', |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 // minValue: '01.01.2001', //todo: gibt es das? |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 // minText: 'Das Datum der Messung darf nicht vor dem 01.01.2001 liegen.', |
627
6742ae5f35dc
Datumsspalte xtype hinzugefügt
Dustin Demuth <dustin@intevation.de>
parents:
588
diff
changeset
|
72 maxValue: Ext.Date.format(new Date(), 'd.m.Y H:i') |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 }, { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 header: 'Status', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 flex: 1, |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
77 dataIndex: 'statusWert', |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
78 renderer: function(value, meta, record, rNdx, cNdx) { |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
79 var statusId = record.get('status'); |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
80 var mId = record.get('id'); |
963
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
81 //also fwd the record to the asynchronous loading of statuswerte |
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
82 // in order to add the statuswert to the record, |
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
83 // after the grid was rendered... |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
84 if (value === '') { |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
85 this.updateStatus(mId, statusId, record); |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
86 return 'Lade...'; |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
87 } |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
88 var sta = Ext.data.StoreManager.getByKey('statuswerte'); |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
89 return sta.getById(value).get('wert'); |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
91 }, { |
1062
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
92 header: 'Stufe', |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
93 flex: 1, |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
94 dataIndex: 'statusStufe', |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
95 renderer: function(value, meta, record, rNdx, cNdx) { |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
96 var statusId = record.get('status'); |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
97 var mId = record.get('id'); |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
98 //also fwd the record to the asynchronous loading of statuswerte |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
99 // in order to add the statuswert to the record, |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
100 // after the grid was rendered... |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
101 if (value === '') { |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
102 this.updateStatus(mId, statusId, record); |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
103 return 'Lade...'; |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
104 } |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
105 var sta = Ext.data.StoreManager.getByKey('statusstufe'); |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
106 return sta.getById(value).get('stufe'); |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
107 } |
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
108 }, { |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 header: 'OK-Flag', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
110 dataIndex: 'fertig', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
111 flex: 1, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
112 renderer: function(value) { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
113 if (value) { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
114 return 'Ja'; |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
115 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
116 return 'Nein'; |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
117 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
118 editor: { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
119 xtype: 'checkboxfield', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
120 allowBlank: false |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
121 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
122 }, { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
123 header: 'Anzahl Nuklide', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
124 // Gibt die Anzahl der Messwerte wieder, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
125 // NICHT die Anzahl der verschiedenen Nukleide |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
126 // Eventuell ist die Bezeichnug daher irreführend |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
127 dataIndex: 'messwerteCount', |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
128 flex: 1, |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
129 renderer: function(value, meta, record) { |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
130 if (value === '') { |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
131 var mId = record.get('id'); |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
132 this.updateNuklide(mId, record); |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
133 return 'Lade...'; |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
134 } |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
135 return value; |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
136 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
137 }, { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
138 header: 'Anzahl Kommentare', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
139 flex: 1, |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
140 dataIndex: 'kommentarCount', |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
141 renderer: function(value, meta, record) { |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
142 if (value === '') { |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
143 var mId = record.get('id'); |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
144 this.updateKommentare(mId, record); |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
145 return 'Lade...'; |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
146 } |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
147 return value; |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
148 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
149 }]; |
823
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
150 this.listeners = { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
151 select: { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
152 fn: this.activateRemoveButton, |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
153 scope: this |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
154 }, |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
155 deselect: { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
156 fn: this.deactivateRemoveButton, |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
157 scope: this |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
158 } |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
159 }; |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
160 this.initData(); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
161 this.callParent(arguments); |
823
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
162 this.setReadOnly(true); //Grid is always initialised as RO |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
163 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
164 |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
165 initData: function() { |
963
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
166 this.setLoading(true); |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
167 this.store = Ext.create('Lada.store.Messungen'); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
168 this.store.load({ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
169 params: { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
170 probeId: this.recordId |
963
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
171 }, |
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
172 callback: function (records, operation, success) { |
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
173 this.setLoading(false); |
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
174 }, |
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
175 scope: this |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
176 }); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
177 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
178 |
945
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
179 /** |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
180 * Load the statusstore, |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
181 * afterwards: retrieve the statusid |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
182 */ |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
183 updateStatus: function(value, statusId, record) { |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
184 var statusStore = Ext.create('Lada.store.Status'); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
185 statusStore.on('load', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
186 this.updateStatusColumn, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
187 this, |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
188 {statusId: statusId, record: record}); |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
189 statusStore.load({ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
190 params: { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
191 messungsId: value |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
192 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
193 }); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
194 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
195 |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
196 updateNuklide: function(id, record) { |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
197 var messwerte = Ext.create('Lada.store.Messwerte'); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
198 messwerte.on('load', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
199 this.updateColumn, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
200 this, |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
201 {record: record, type: 'messwerteCount'}); |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
202 messwerte.load({ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
203 params: { |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
204 messungsId: id |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
205 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
206 }); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
207 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
208 |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
209 updateKommentare: function(id, record) { |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
210 var kommentare = Ext.create('Lada.store.MKommentare'); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
211 kommentare.on('load', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
212 this.updateColumn, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
213 this, |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
214 {record: record, type: 'kommentarCount'}); |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
215 kommentare.load({ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
216 params: { |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
217 messungsId: id |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
218 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
219 }); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
220 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
221 |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
222 updateColumn: function(store, record, success, opts) { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
223 var value; |
973
989736bf4ffb
Show different Message in a MessungGrid when it is not allowed to see the number of Nuclids for a Messung in Cases the status is not set
Dustin Demuth <dustin@intevation.de>
parents:
963
diff
changeset
|
224 if (success) { |
989736bf4ffb
Show different Message in a MessungGrid when it is not allowed to see the number of Nuclids for a Messung in Cases the status is not set
Dustin Demuth <dustin@intevation.de>
parents:
963
diff
changeset
|
225 if (store.getTotalCount() === 0) { |
989736bf4ffb
Show different Message in a MessungGrid when it is not allowed to see the number of Nuclids for a Messung in Cases the status is not set
Dustin Demuth <dustin@intevation.de>
parents:
963
diff
changeset
|
226 value = 'Keine'; |
989736bf4ffb
Show different Message in a MessungGrid when it is not allowed to see the number of Nuclids for a Messung in Cases the status is not set
Dustin Demuth <dustin@intevation.de>
parents:
963
diff
changeset
|
227 } |
989736bf4ffb
Show different Message in a MessungGrid when it is not allowed to see the number of Nuclids for a Messung in Cases the status is not set
Dustin Demuth <dustin@intevation.de>
parents:
963
diff
changeset
|
228 else { |
989736bf4ffb
Show different Message in a MessungGrid when it is not allowed to see the number of Nuclids for a Messung in Cases the status is not set
Dustin Demuth <dustin@intevation.de>
parents:
963
diff
changeset
|
229 value = store.getTotalCount(); |
989736bf4ffb
Show different Message in a MessungGrid when it is not allowed to see the number of Nuclids for a Messung in Cases the status is not set
Dustin Demuth <dustin@intevation.de>
parents:
963
diff
changeset
|
230 } |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
231 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
232 else { |
973
989736bf4ffb
Show different Message in a MessungGrid when it is not allowed to see the number of Nuclids for a Messung in Cases the status is not set
Dustin Demuth <dustin@intevation.de>
parents:
963
diff
changeset
|
233 value = 'k.A.'; |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
234 } |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
235 opts.record.beginEdit(); |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
236 opts.record.set(opts.type, value); |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
237 opts.record.endEdit(); |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
238 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
239 |
945
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
240 /** |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
241 * Retrieve Statuswert and update the column |
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
242 */ |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
243 updateStatusColumn: function(sstore, record, success, opts) { |
945
023e622f9551
Added the ability to work with "StatusWerten" which are delivered by the lada-server.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
244 var value = 0; |
950
c7bf0b459074
Fixed some issues when the status is null
Dustin Demuth <dustin@intevation.de>
parents:
945
diff
changeset
|
245 if (sstore.getTotalCount() === 0 || !opts.statusId) { |
813
ee8cce4b4522
In some cases there was an error bc. the Item in the StatuswerteStore was not found. this is fixed now.
Dustin Demuth <dustin@intevation.de>
parents:
799
diff
changeset
|
246 value = 0; |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
247 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
248 else { |
963
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
249 var rec = sstore.getById(opts.statusId); |
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
250 if (rec) { |
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
251 value = rec.get('statusWert'); |
1062
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
252 var stufe = rec.get('statusStufe'); |
963
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
253 //add the determined statuswert to the record. |
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
254 // this is necessary to let the controller determine |
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
255 // which actions are allowed. |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
256 opts.record.beginEdit(); |
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
257 opts.record.set('statusWert', value); |
1062
0497693d5b74
Show statusStufe in messunggrid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1057
diff
changeset
|
258 opts.record.set('statusStufe', stufe); |
1032
fa04558f35cd
Load messung grid columns as record fields to get rid of 'Ext.fly'
Raimund Renkert <raimund.renkert@intevation.de>
parents:
973
diff
changeset
|
259 opts.record.endEdit(); |
963
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
955
diff
changeset
|
260 } |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
261 } |
684
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
262 }, |
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
263 |
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
264 setReadOnly: function(b) { |
1034
4d4de99bbe53
Get rid of double setting readOnly status of probe window child elements.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1033
diff
changeset
|
265 this.readOnly = b; |
4d4de99bbe53
Get rid of double setting readOnly status of probe window child elements.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1033
diff
changeset
|
266 if (b === true) { |
684
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
267 //Readonly |
1035
479782c96efa
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1034
diff
changeset
|
268 if (this.getPlugin('rowedit')) { |
684
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
269 this.getPlugin('rowedit').disable(); |
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
270 } |
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
271 this.down('button[action=delete]').disable(); |
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
272 this.down('button[action=add]').disable(); |
1035
479782c96efa
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1034
diff
changeset
|
273 } |
479782c96efa
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1034
diff
changeset
|
274 else { |
684
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
275 //Writable |
1035
479782c96efa
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1034
diff
changeset
|
276 if (this.getPlugin('rowedit')) { |
684
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
277 this.getPlugin('rowedit').enable(); |
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
278 } |
823
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
279 //this.down('button[action=delete]').enable(); |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
280 //always disabled, unless a row was selected |
684
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
281 this.down('button[action=add]').enable(); |
69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
Dustin Demuth <dustin@intevation.de>
parents:
627
diff
changeset
|
282 } |
823
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
283 }, |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
284 /** |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
285 * Activate the Remove Button |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
286 */ |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
287 activateRemoveButton: function(selection, record) { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
288 var grid = this; |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
289 //only enable the remove buttone, when the grid is editable. |
1033
e4b6b6c5fb89
Use 'owner' attribute to set messung grid and button RO status.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1032
diff
changeset
|
290 if (! grid.readOnly && |
e4b6b6c5fb89
Use 'owner' attribute to set messung grid and button RO status.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1032
diff
changeset
|
291 record.get('statusWert') === 0 && |
e4b6b6c5fb89
Use 'owner' attribute to set messung grid and button RO status.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1032
diff
changeset
|
292 record.get('owner')) { |
823
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
293 grid.down('button[action=delete]').enable(); |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
294 } |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
295 }, |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
296 /** |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
297 * Activate the Remove Button |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
298 */ |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
299 deactivateRemoveButton: function(selection, record) { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
300 var grid = this; |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
301 //only enable the remove buttone, when the grid is editable. |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
302 if (! grid.readOnly) { |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
303 grid.down('button[action=delete]').disable(); |
5ed0e6273888
Only enable delete button in grids when an entry was selected
Dustin Demuth <dustin@intevation.de>
parents:
813
diff
changeset
|
304 } |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
305 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
306 }); |