annotate app/view/grid/MessungList.js @ 1345:da98f0e7c288

Check for empty values in ort grid.
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 06 Feb 2017 11:57:05 +0100
parents e76551a6da27
children
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', {
1112
e76551a6da27 Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1109
diff changeset
20 checkOnly: true,
e76551a6da27 Use custom row expander in messung list grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1109
diff changeset
21 injectCheckbox: 1
1076
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
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 this.dockedItems = [{
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 xtype: 'toolbar',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 dock: 'top',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 items: [{
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 xtype: 'tbtext',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 text: i18n.getMsg('messung.gridTitle')
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 {
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 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
34 icon: 'resources/img/printer.png',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 action: 'print',
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 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
37 }, {
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 text: i18n.getMsg('statusSetzen'),
1109
05948135ce75 Updated icons for status edit in messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1082
diff changeset
39 icon: 'resources/img/mail-mark-notjunk.png',
1082
dbd435256f77 Open status edit window and send status objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1076
diff changeset
40 action: 'setstatus',
1076
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 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
42 }]
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 }];
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 this.columns = [];
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 this.callParent(arguments);
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 /**
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 * 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
50 * 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
51 * search event}
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 * 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
53 * 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
54 * 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
55 */
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 setupColumns: function(cols) {
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 var caf = this.generateColumnsAndFields(cols);
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 var columns = caf[0];
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 var fields = caf[1];
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 var i18n = Lada.getApplication().bundle;
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 this.store.model.setFields(fields);
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 this.reconfigure(this.store, columns);
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 }
e32c10cf5499 Added model/store, view and controller for messung list.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 });

http://lada.wald.intevation.org