Mercurial > lada > lada-client
comparison app/view/grid/MKommentar.js @ 596:b0a3580a41e9
Added messung kommentar grid and controller.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 12 Mar 2015 09:48:36 +0100 |
parents | |
children | 13e5473d1af5 |
comparison
equal
deleted
inserted
replaced
595:a81dafe06d1d | 596:b0a3580a41e9 |
---|---|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU GPL (v>=3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out | |
6 * the documentation coming with IMIS-Labordaten-Application for details. | |
7 */ | |
8 | |
9 /* | |
10 * Grid to list Kommentare for Messunge | |
11 */ | |
12 Ext.define('Lada.view.grid.MKommentar', { | |
13 extend: 'Ext.grid.Panel', | |
14 alias: 'widget.mkommentargrid', | |
15 | |
16 maxHeight: 350, | |
17 emptyText: 'Keine Kommentare gefunden.', | |
18 minHeight: 110, | |
19 viewConfig: { | |
20 deferEmptyText: false | |
21 }, | |
22 | |
23 recordId: null, | |
24 | |
25 initComponent: function() { | |
26 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { | |
27 clicksToMoveEditor: 1, | |
28 autoCancel: false | |
29 }); | |
30 this.plugins = [this.rowEditing]; | |
31 this.dockedItems = [{ | |
32 xtype: 'toolbar', | |
33 dock: 'bottom', | |
34 items: ['->', { | |
35 text: 'Hinzufügen', | |
36 icon: 'resources/img/list-add.png', | |
37 action: 'add' | |
38 }, { | |
39 text: 'Löschen', | |
40 icon: 'resources/img/list-remove.png', | |
41 action: 'delete' | |
42 }] | |
43 }]; | |
44 this.columns = [{ | |
45 header: 'Erzeuger', | |
46 dataIndex: 'erzeuger', | |
47 renderer: function(value) { | |
48 if (!value || value === '') { | |
49 return ''; | |
50 } | |
51 var mstore = Ext.data.StoreManager.get('messstellen'); | |
52 return mstore.getById(value).get('messStelle'); | |
53 }, | |
54 editor: { | |
55 xtype: 'combobox', | |
56 store: Ext.data.StoreManager.get('messstellen'), | |
57 displayField: 'messStelle', | |
58 valueField: 'id', | |
59 allowBlank: false | |
60 } | |
61 }, { | |
62 header: 'Datum', | |
63 dataIndex: 'datum', | |
64 editor: { | |
65 xtype: 'datefield', | |
66 allowBlank: false, | |
67 format: 'd.m.Y', | |
68 maxValue: Ext.Date.format(new Date(), 'd.m.Y') | |
69 } | |
70 }, { | |
71 header: 'Text', | |
72 dataIndex: 'text', | |
73 flex: 1, | |
74 editor: { | |
75 allowBlank: false | |
76 } | |
77 }]; | |
78 this.initData(); | |
79 this.callParent(arguments); | |
80 }, | |
81 | |
82 initData: function() { | |
83 if (this.store) { | |
84 this.store.removeAll(); | |
85 } | |
86 else { | |
87 this.store = Ext.create('Lada.store.MKommentare'); | |
88 } | |
89 this.store.load({ | |
90 params: { | |
91 messungsId: this.recordId | |
92 } | |
93 }); | |
94 } | |
95 }); |