Mercurial > lada > lada-client
annotate app/view/status/List.js @ 546:43951e42590c
Added tag mockup-1.1 for changeset 7c9475119861
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 18 Dec 2014 16:52:45 +0100 |
parents | 7c9475119861 |
children |
rev | line source |
---|---|
472
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
2 * Software engineering by Intevation GmbH |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
3 * |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
497
7c0653e8d9f7
Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
491
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
472
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
7 */ |
debfcc7713e3
Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
391
diff
changeset
|
8 |
350
b7c419a2b476
Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
201
diff
changeset
|
9 /* |
b7c419a2b476
Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
201
diff
changeset
|
10 * Grid to list Status |
b7c419a2b476
Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
201
diff
changeset
|
11 */ |
497
7c0653e8d9f7
Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
491
diff
changeset
|
12 Ext.define('Lada.view.status.List', { |
182
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.grid.Panel', |
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.statuslist', |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
15 |
182
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
16 store: 'Status', |
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
17 viewConfig: { |
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
18 maxHeight: 350, |
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
19 emptyText: 'Keine Statusangaben gefunden.', |
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
20 // minHeight and deferEmptyText are needed to be able to show the |
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
21 // emptyText message. |
530
95bad130be98
Increased list grid height.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
523
diff
changeset
|
22 minHeight: 65, |
182
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
23 deferEmptyText: false |
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
24 }, |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
25 |
201
7997272bbf4b
Added messungsid to the status list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
182
diff
changeset
|
26 parentId: null, |
182
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
27 probeId: null, |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
28 |
182
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
29 initComponent: function() { |
523
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
30 var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
31 clicksToMoveEditor: 1, |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
32 autoCancel: false |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
33 }); |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
34 this.plugins = [rowEditing]; |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
35 this.dockedItems = [{ |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
36 xtype: 'toolbar', |
513
6de00657cd87
Moved alll list toolbars to bottom and buttons to the right.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
497
diff
changeset
|
37 dock: 'bottom', |
6de00657cd87
Moved alll list toolbars to bottom and buttons to the right.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
497
diff
changeset
|
38 items: ['->', { |
540
99e738c17b81
Add detail button to tables
Roland Geider <roland.geider@intevation.de>
parents:
530
diff
changeset
|
39 text: 'Details', |
99e738c17b81
Add detail button to tables
Roland Geider <roland.geider@intevation.de>
parents:
530
diff
changeset
|
40 icon: 'gfx/document-open.png', |
545
7c9475119861
Enable the 'details' button only when an item is selected
Roland Geider <roland.geider@intevation.de>
parents:
540
diff
changeset
|
41 action: 'open', |
7c9475119861
Enable the 'details' button only when an item is selected
Roland Geider <roland.geider@intevation.de>
parents:
540
diff
changeset
|
42 disabled: true |
540
99e738c17b81
Add detail button to tables
Roland Geider <roland.geider@intevation.de>
parents:
530
diff
changeset
|
43 }, { |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
44 text: 'Hinzufügen', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
45 icon: 'gfx/list-add.png', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
46 action: 'add', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
47 probeId: this.probeId, |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
48 parentId: this.parentId |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
49 }, { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
50 text: 'Löschen', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
51 icon: 'gfx/list-remove.png', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
52 action: 'delete' |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
53 }] |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
54 }]; |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
55 this.columns = [{ |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
56 header: 'Erzeuger', |
523
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
57 dataIndex: 'erzeuger', |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
58 editor: { |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
59 allowBlank: false |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
60 } |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
61 }, { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
62 header: 'Status', |
523
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
63 dataIndex: 'status', |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
64 editor: { |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
65 allowBlank: false |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
66 } |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
67 }, { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
68 header: 'Datum', |
523
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
69 dataIndex: 'datum', |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
70 editor: { |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
71 xtype: 'datefield', |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
72 allowBlank: false, |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
73 format: 'd.m.Y', |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
74 maxValue: Ext.Date.format(new Date(), 'd.m.Y') |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
75 } |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
76 }, { |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
77 header: 'Text', |
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
78 dataIndex: 'kommentar', |
523
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
79 flex: 1, |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
80 editor: { |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
81 allowBlank: true |
6ad453afbc31
Make tables editable for 'Status'
Roland Geider <roland.geider@intevation.de>
parents:
513
diff
changeset
|
82 } |
491
850ccfe5f3c4
Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
490
diff
changeset
|
83 }]; |
182
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
84 this.callParent(arguments); |
545
7c9475119861
Enable the 'details' button only when an item is selected
Roland Geider <roland.geider@intevation.de>
parents:
540
diff
changeset
|
85 }, |
7c9475119861
Enable the 'details' button only when an item is selected
Roland Geider <roland.geider@intevation.de>
parents:
540
diff
changeset
|
86 listeners: { |
7c9475119861
Enable the 'details' button only when an item is selected
Roland Geider <roland.geider@intevation.de>
parents:
540
diff
changeset
|
87 selectionchange: function(model, selected, eOpts) { |
7c9475119861
Enable the 'details' button only when an item is selected
Roland Geider <roland.geider@intevation.de>
parents:
540
diff
changeset
|
88 /* |
7c9475119861
Enable the 'details' button only when an item is selected
Roland Geider <roland.geider@intevation.de>
parents:
540
diff
changeset
|
89 * Enable the 'details' button only when an item is selected |
7c9475119861
Enable the 'details' button only when an item is selected
Roland Geider <roland.geider@intevation.de>
parents:
540
diff
changeset
|
90 */ |
7c9475119861
Enable the 'details' button only when an item is selected
Roland Geider <roland.geider@intevation.de>
parents:
540
diff
changeset
|
91 if (selected.length > 0) { |
7c9475119861
Enable the 'details' button only when an item is selected
Roland Geider <roland.geider@intevation.de>
parents:
540
diff
changeset
|
92 this.down('button[action=open]').enable(); |
7c9475119861
Enable the 'details' button only when an item is selected
Roland Geider <roland.geider@intevation.de>
parents:
540
diff
changeset
|
93 } |
7c9475119861
Enable the 'details' button only when an item is selected
Roland Geider <roland.geider@intevation.de>
parents:
540
diff
changeset
|
94 } |
182
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
95 } |
23f74ae3bb87
Added missing files.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
96 }); |