Mercurial > lada > lada-client
annotate app/view/grid/PKommentar.js @ 669:8756f7e423fb openid
Cosmetics.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 19 Mar 2015 14:30:06 +0100 |
parents | 2c8aa09402a2 |
children | 612f4f933083 |
rev | line source |
---|---|
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 * |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 */ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 /* |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 * Grid to list Kommentare |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 */ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.grid.PKommentar', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.grid.Panel', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.pkommentargrid', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 requires: [ |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
17 'Ext.toolbar.Toolbar', |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
18 'Lada.store.PKommentare' |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 ], |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 maxHeight: 350, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 emptyText: 'Keine Kommentaregefunden.', |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
23 minHeight: 110, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 viewConfig: { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 deferEmptyText: false |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 }, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 recordId: null, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 initComponent: function() { |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
31 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 clicksToMoveEditor: 1, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 autoCancel: false |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 }); |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
35 this.plugins = [this.rowEditing]; |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 this.dockedItems = [{ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 xtype: 'toolbar', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 dock: 'bottom', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 items: ['->', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 text: 'Hinzufügen', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 icon: 'resources/img/list-add.png', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 action: 'add', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 probeId: this.probeId |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 }, { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 text: 'Löschen', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 icon: 'resources/img/list-remove.png', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 action: 'delete' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 }] |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 }]; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 this.columns = [{ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 header: 'Erzeuger', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 dataIndex: 'erzeuger', |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
53 width: 140, |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
54 renderer: function(value) { |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
55 if (!value || value === '') { |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
56 return ''; |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
57 } |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
58 var store = Ext.data.StoreManager.get('messstellen'); |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
59 var record = store.getById(value); |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
60 return record.get('messStelle'); |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
61 }, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 editor: { |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
63 xtype: 'combobox', |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
64 store: Ext.data.StoreManager.get('messstellen'), |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
65 displayField: 'messStelle', |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
66 valueField: 'id', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 allowBlank: false |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 }, { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 header: 'Datum', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 dataIndex: 'datum', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 editor: { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 xtype: 'datefield', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 allowBlank: false, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 format: 'd.m.Y', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 maxValue: Ext.Date.format(new Date(), 'd.m.Y') |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 }, { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
79 header: 'Text', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
80 dataIndex: 'text', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
81 flex: 1, |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
82 renderer: function(value) { |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
83 return '<div style="white-space: normal !important;">' + |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
84 value + '</div>'; |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
85 }, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
86 editor: { |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
87 xtype: 'textarea', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
88 allowBlank: false |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
89 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 }]; |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
91 this.initData(); |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
92 this.callParent(arguments); |
572
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
93 }, |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
94 |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
95 initData: function() { |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
96 this.store = Ext.create('Lada.store.PKommentare'); |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
97 this.store.load({ |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
98 params: { |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
99 probeId: this.recordId |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
100 } |
2c8aa09402a2
Added controller for PKommentarGrid and implemented update/add/delete.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
548
diff
changeset
|
101 }); |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
103 }); |