annotate app/view/grid/MessungList.js @ 1104:414f7c9908d6

some reorg of filterpanal and messprogramm form
author Michael Stanko <mstanko@bfs.de>
date Wed, 11 May 2016 08:57:40 +0200
parents dbd435256f77
children 05948135ce75
rev   line source
1076
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9 /**
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 * Grid to list the result of the Filter
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 */
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.grid.MessungList', {
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Lada.view.widget.DynamicGrid',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 alias: 'widget.messunglistgrid',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 initComponent: function() {
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 var i18n = Lada.getApplication().bundle;
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 this.emptyText = i18n.getMsg('messung.emptyGrid');
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 this.selModel = Ext.create('Ext.selection.CheckboxModel', {
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 checkOnly: true
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21 });
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 this.dockedItems = [{
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 xtype: 'toolbar',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 dock: 'top',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 items: [{
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 xtype: 'tbtext',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 text: i18n.getMsg('messung.gridTitle')
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 },
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 '->',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 {
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32 text: i18n.getMsg('probe.button.print'),
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 icon: 'resources/img/printer.png',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34 action: 'print',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 disabled: true //disabled on start, enabled by the controller
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 }, {
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 text: i18n.getMsg('statusSetzen'),
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 icon: 'resources/img/emblem-important.png',
1082
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1076
diff changeset
39 action: 'setstatus',
1076
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 disabled: true //disabled on start, enabled by the controller
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 }]
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 }];
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 this.columns = [];
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 this.callParent(arguments);
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 },
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 /**
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 * Setup columns of the Grid dynamically based on a list of given cols.
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 * The function is called from the {@link Lada.controller.Filter#search
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 * search event}
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 * The Images for the Read-Write Icon are defined in CSS
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 * This Method overrides setupColumns of the parents class,
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 * becaus the delete colum is required.
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 */
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 setupColumns: function(cols) {
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 var caf = this.generateColumnsAndFields(cols);
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 var columns = caf[0];
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 var fields = caf[1];
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 var i18n = Lada.getApplication().bundle;
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 this.store.model.setFields(fields);
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 this.reconfigure(this.store, columns);
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 }
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 });

http://lada.wald.intevation.org