Mercurial > lada > lada-client
annotate app/view/grid/FilterResult.js @ 927:a1783726d43e
Serialize empty solldatum values to 'null'.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 11 Sep 2015 14:33:11 +0200 |
parents | 7cbbe0485d0d |
children |
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 |
893
07dfcdf5b41f
jsduck for grids and panels
Dustin Demuth <dustin@intevation.de>
parents:
878
diff
changeset
|
9 /** |
07dfcdf5b41f
jsduck for grids and panels
Dustin Demuth <dustin@intevation.de>
parents:
878
diff
changeset
|
10 * Grid to list the result of the Filter |
548
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.FilterResult', { |
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.filterresultgrid', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 |
856
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
16 requires: 'Lada.view.window.DeleteProbe', |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
17 |
751
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
18 store: null, //'ProbenList', |
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 multiSelect: true, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 viewConfig: { |
753
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
23 emptyText: 'Keine Ergebnisse gefunden.', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 deferEmptyText: false |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 }, |
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 initComponent: function() { |
837
d054732bc7a2
Switch the Mode of the Filterresultgrid according to the selection of the radio buttons in the probenplanungswitcher
Dustin Demuth <dustin@intevation.de>
parents:
806
diff
changeset
|
28 var i18n = Lada.getApplication().bundle; |
d054732bc7a2
Switch the Mode of the Filterresultgrid according to the selection of the radio buttons in the probenplanungswitcher
Dustin Demuth <dustin@intevation.de>
parents:
806
diff
changeset
|
29 |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 this.dockedItems = [{ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 xtype: 'toolbar', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 dock: 'top', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 items: [{ |
753
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
34 xtype: 'tbtext', |
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
35 id: 'tbtitle', |
837
d054732bc7a2
Switch the Mode of the Filterresultgrid according to the selection of the radio buttons in the probenplanungswitcher
Dustin Demuth <dustin@intevation.de>
parents:
806
diff
changeset
|
36 text: i18n.getMsg('probelist') |
753
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
37 }, |
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
38 '->', |
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
39 { |
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
40 text: 'Probe erstellen', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 icon: 'resources/img/list-add.png', |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
42 action: 'addProbe', |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
43 disabled: false |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 }, { |
753
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
45 text: 'Proben Importieren', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 icon: 'resources/img/svn-commit.png', |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
47 action: 'import', |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
48 disabled: false |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 }, { |
753
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
50 text: 'Proben Exportieren', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 icon: 'resources/img/svn-update.png', |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
52 action: 'export', |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
53 disabled: true |
923
7cbbe0485d0d
Added a Print-button which sends a selection of proben to a service which still has to be specified.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
54 }, { |
7cbbe0485d0d
Added a Print-button which sends a selection of proben to a service which still has to be specified.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
55 text: 'Auswahl Drucken', |
7cbbe0485d0d
Added a Print-button which sends a selection of proben to a service which still has to be specified.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
56 icon: 'resources/img/printer.png', |
7cbbe0485d0d
Added a Print-button which sends a selection of proben to a service which still has to be specified.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
57 action: 'print', |
7cbbe0485d0d
Added a Print-button which sends a selection of proben to a service which still has to be specified.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
58 disabled: true |
860
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
59 }, |
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
60 '-', |
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
61 { |
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
62 text: 'Messprogramm erstellen', |
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
63 icon: 'resources/img/list-add.png', |
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
64 action: 'addMessprogramm', |
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
65 disabled: true |
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
66 }, { |
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
67 text: 'Proben generieren', |
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
68 icon: 'resources/img/view-time-schedule-insert.png', |
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
69 action: 'genProbenFromMessprogramm', |
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
70 disabled: true |
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
71 }] |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 }]; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 this.columns = []; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 this.callParent(arguments); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 }, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 /** |
751
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
78 * This sets the Store of the FilterResultGrid |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
79 */ |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
80 setStore: function(store){ |
753
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
81 var i18n = Lada.getApplication().bundle; |
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
82 |
751
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
83 this.removeDocked(Ext.getCmp('ptbar'), true); |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
84 this.reconfigure(store); |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
85 this.addDocked([{ |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
86 xtype: 'pagingtoolbar', |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
87 id: 'ptbar', |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
88 dock: 'bottom', |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
89 store: store, |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
90 displayInfo: true |
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
91 }]); |
753
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
92 |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
93 //Configure the Toolbar. |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
94 this.setMode(store); |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
95 }, |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
96 |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
97 /** |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
98 * Enables or disables Toolbar-Buttons according to the selected mode |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
99 */ |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
100 setMode: function(store) { |
753
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
101 var t = Ext.getCmp('tbtitle'); |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
102 var i18n = Lada.getApplication().bundle; |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
103 if (store.model.modelName == 'Lada.model.ProbeList'){ |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
104 t.setText(i18n.getMsg('probelist')); |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
105 this.down('button[action=addMessprogramm]').disable(); |
860
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
106 this.down('button[action=genProbenFromMessprogramm]').disable(); |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
107 this.down('button[action=addProbe]').enable(); |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
108 this.down('button[action=import]').enable(); |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
109 this.down('button[action=export]').enable(); |
923
7cbbe0485d0d
Added a Print-button which sends a selection of proben to a service which still has to be specified.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
110 this.down('button[action=print]').enable(); |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
111 } |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
112 else if (store.model.modelName == 'Lada.model.MessprogrammList') { |
753
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
113 t.setText(i18n.getMsg('probeplanning')); |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
114 this.down('button[action=addMessprogramm]').enable(); |
860
03f39ddae596
Restructured Filterresultgrid button-dock, added button to generate Proben from a selection of messprogramme.
Dustin Demuth <dustin@intevation.de>
parents:
856
diff
changeset
|
115 this.down('button[action=genProbenFromMessprogramm]').enable(); |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
116 this.down('button[action=addProbe]').disable(); |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
117 this.down('button[action=import]').disable(); |
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
118 this.down('button[action=export]').disable(); |
923
7cbbe0485d0d
Added a Print-button which sends a selection of proben to a service which still has to be specified.
Dustin Demuth <dustin@intevation.de>
parents:
893
diff
changeset
|
119 this.down('button[action=print]').disable(); |
753
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
120 } |
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
121 else { |
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
122 t.setText(''); |
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
123 console.log('The model '+store.model.modelName+ |
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
124 'was not defined in the FilterResultGrid.' + |
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
125 ' Hence the title could not be set.'); |
4dd0c645ea8b
Display a Title in the Toolbar
Dustin Demuth <dustin@intevation.de>
parents:
751
diff
changeset
|
126 } |
751
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
127 }, |
792
d572ee3271ac
some work on a context-sensitive toolbar
Dustin Demuth <dustin@intevation.de>
parents:
755
diff
changeset
|
128 |
751
704bb359c0fe
dynamically exchange the store of the resultfiltergrid
Dustin Demuth <dustin@intevation.de>
parents:
682
diff
changeset
|
129 /** |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 * Setup columns of the Grid dynamically based on a list of given cols. |
795
255568e97c96
Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents:
792
diff
changeset
|
131 * The function is called from the {@link Lada.controller.Filter#search |
255568e97c96
Latest commit broke the search function
Dustin Demuth <dustin@intevation.de>
parents:
792
diff
changeset
|
132 * search event} |
878
545b8913601d
Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
Dustin Demuth <dustin@intevation.de>
parents:
868
diff
changeset
|
133 * The Images for the Read-Write Icon are defined in CSS |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
134 */ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
135 setupColumns: function(cols) { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
136 var resultColumns = []; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
137 var fields = []; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
138 |
856
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
139 fields.push(new Ext.data.Field({ |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
140 name: 'owner' |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
141 })); |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
142 fields.push(new Ext.data.Field({ |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
143 name: 'readonly' |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
144 })); |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
145 |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
146 resultColumns.push({ |
878
545b8913601d
Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
Dustin Demuth <dustin@intevation.de>
parents:
868
diff
changeset
|
147 xtype: 'actioncolumn', |
545b8913601d
Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
Dustin Demuth <dustin@intevation.de>
parents:
868
diff
changeset
|
148 text: 'RW', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
149 dataIndex: 'readonly', |
682
7b6467edfdfc
RW Column may not be sortable
Dustin Demuth <dustin@intevation.de>
parents:
656
diff
changeset
|
150 sortable: false, |
878
545b8913601d
Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
Dustin Demuth <dustin@intevation.de>
parents:
868
diff
changeset
|
151 tooltip: 'Probe öffnen', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
152 width: 30, |
878
545b8913601d
Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
Dustin Demuth <dustin@intevation.de>
parents:
868
diff
changeset
|
153 getClass: function (val, meta, rec) { |
545b8913601d
Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
Dustin Demuth <dustin@intevation.de>
parents:
868
diff
changeset
|
154 return rec.get('readonly') === false ? "edit" : "noedit"; |
545b8913601d
Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
Dustin Demuth <dustin@intevation.de>
parents:
868
diff
changeset
|
155 }, |
545b8913601d
Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
Dustin Demuth <dustin@intevation.de>
parents:
868
diff
changeset
|
156 handler: function(grid, rowIndex, colIndex) { |
545b8913601d
Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
Dustin Demuth <dustin@intevation.de>
parents:
868
diff
changeset
|
157 var rec = grid.getStore().getAt(rowIndex); |
545b8913601d
Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
Dustin Demuth <dustin@intevation.de>
parents:
868
diff
changeset
|
158 grid.fireEvent('itemdblclick', grid, rec); |
545b8913601d
Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
Dustin Demuth <dustin@intevation.de>
parents:
868
diff
changeset
|
159 } |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
160 }); |
856
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
161 |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
162 for (var i = cols.length - 1; i >= 0; i--) { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
163 if (cols[i] === 'id') { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
164 continue; |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
165 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
166 resultColumns.push(cols[i]); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
167 fields.push(new Ext.data.Field({ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
168 name: cols[i].dataIndex |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
169 })); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
170 } |
856
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
171 if (this.store.$className == 'Lada.store.ProbenList') { |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
172 // Add a Delete-Button |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
173 // TODO: Might need to be extended to Messprogramme |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
174 resultColumns.push({ |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
175 xtype: 'actioncolumn', |
878
545b8913601d
Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
Dustin Demuth <dustin@intevation.de>
parents:
868
diff
changeset
|
176 text: 'Aktion', |
856
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
177 sortable: false, |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
178 width: 30, |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
179 items: [{ |
868
b90e29b22ea6
Fixed path to image.
Raimund Renkert <rrenkert@intevation.de>
parents:
860
diff
changeset
|
180 icon: 'resources/img/edit-delete.png', |
856
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
181 tooltip: 'Löschen', |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
182 isDisabled: function(grid, rowIndex, colIndex) { |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
183 var rec = grid.getStore().getAt(rowIndex); |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
184 if ( rec.get('readonly') || !rec.get('owner')) { |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
185 return true; |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
186 } |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
187 return false; |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
188 }, |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
189 handler: function(grid, rowIndex, colIndex){ |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
190 var rec = grid.getStore().getAt(rowIndex); |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
191 |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
192 var winname = 'Lada.view.window.DeleteProbe'; |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
193 var win = Ext.create(winname, { |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
194 record: rec, |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
195 parentWindow: this |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
196 }); |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
197 win.show(); |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
198 win.initData(); |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
199 } |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
200 }] |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
201 }); |
e44070aa45d2
Implemented a 'Delete Button' in the ResultGrid. Proben can be deleted when they are not ReadOnly and the Users is the Owner of the Probe
Dustin Demuth <dustin@intevation.de>
parents:
837
diff
changeset
|
202 } |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
203 this.store.model.setFields(fields); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
204 this.reconfigure(this.store, resultColumns); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
205 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
206 }); |