comparison app/view/messungen/List.js @ 491:850ccfe5f3c4

Code style.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 31 Oct 2014 23:23:32 +0100
parents 446e99cfd425
children 484e12e89d54
comparison
equal deleted inserted replaced
490:446e99cfd425 491:850ccfe5f3c4
10 * Grid to list Messungen 10 * Grid to list Messungen
11 */ 11 */
12 Ext.define('Lada.view.messungen.List' ,{ 12 Ext.define('Lada.view.messungen.List' ,{
13 extend: 'Ext.grid.Panel', 13 extend: 'Ext.grid.Panel',
14 alias: 'widget.messungenlist', 14 alias: 'widget.messungenlist',
15
15 store: 'Messungen', 16 store: 'Messungen',
16 viewConfig: { 17 viewConfig: {
17 maxHeight: 350, 18 maxHeight: 350,
18 emptyText: 'Keine Messungen gefunden.', 19 emptyText: 'Keine Messungen gefunden.',
19 // minHeight and deferEmptyText are needed to be able to show the 20 // minHeight and deferEmptyText are needed to be able to show the
20 // emptyText message. 21 // emptyText message.
21 minHeight: 35, 22 minHeight: 35,
22 deferEmptyText: false 23 deferEmptyText: false
23 }, 24 },
25
24 probeId: null, 26 probeId: null,
27
25 initComponent: function() { 28 initComponent: function() {
26 this.dockedItems = [ 29 this.dockedItems = [{
27 { 30 xtype: 'toolbar',
28 xtype: 'toolbar', 31 dock: 'top',
29 dock: 'top', 32 items: [{
30 items: [ 33 text: 'Hinzufügen',
31 { 34 icon: 'gfx/list-add.png',
32 text: 'Hinzufügen', 35 action: 'add',
33 icon: 'gfx/list-add.png', 36 probeId: this.probeId
34 action: 'add', 37 }, {
35 probeId: this.probeId 38 text: 'Löschen',
36 }, 39 icon: 'gfx/list-remove.png',
37 { 40 action: 'delete'
38 text: 'Löschen', 41 }]
39 icon: 'gfx/list-remove.png', 42 }];
40 action: 'delete' 43 this.columns = [{
44 header: 'Mess.ID',
45 dataIndex: "id",
46 width: 50
47 }, {
48 header: 'NPR-Nr.',
49 dataIndex: "nebenprobenNr",
50 width: 50
51 }, {
52 header: 'MMT',
53 dataIndex: "mmtId",
54 width: 50
55 }, {
56 header: 'Messzeit',
57 dataIndex: "messzeitpunkt"
58 }, {
59 header: 'Status',
60 dataIndex: 'id',
61 renderer: function(value) {
62 var sstore = Ext.getStore('Status');
63 sstore.load({
64 params: {
65 probeId: value.probeId,
66 messungsId: value.id
41 } 67 }
42 ] 68 });
43 } 69 if (sstore.getTotalCount() === 0) {
44 ]; 70 return "unbekannt";
45 this.columns = [ 71 } else {
46 {header: 'Mess.ID', dataIndex: "id", width: 50}, 72 return sstore.last().get('status');
47 {header: 'NPR-Nr.', dataIndex: "nebenprobenNr", width: 50},
48 {header: 'MMT', dataIndex: "mmtId", width: 50},
49 {header: 'Messzeit', dataIndex: "messzeitpunkt"},
50 {
51 header: 'Status',
52 dataIndex: 'id',
53 renderer: function(value) {
54 var sstore = Ext.getStore('Status');
55 sstore.load({
56 params: {
57 probeId: value.probeId,
58 messungsId: value.id
59 }
60 });
61 if (sstore.getTotalCount() === 0) {
62 return "unbekannt";
63 } else {
64 return sstore.last().get('status');
65 }
66 }
67 },
68 {
69 header: 'OK-Flag',
70 dataIndex: "fertig",
71 renderer: function(value) {
72 if (value) {
73 return "Ja";
74 } else {
75 return "Nein";
76 }
77 }
78 },
79 {
80 header: 'Anzahl Nuklide',
81 dataIndex: 'id',
82 renderer: function(value) {
83 var mstore = Ext.getStore('Messwerte');
84 mstore.load({
85 params: {
86 probeId: value.probeId,
87 messungsId: value.id
88 }
89 });
90 return mstore.getTotalCount();
91 }
92 },
93 {
94 header: 'Anzahl Kommentare',
95 flex: 1,
96 dataIndex: 'id',
97 renderer: function(value) {
98 var kstore = Ext.getStore('KommentareM');
99 kstore.load({
100 params: {
101 probeId: value.probeId,
102 messungsId: value.id
103 }
104 });
105 return kstore.getTotalCount();
106 } 73 }
107 } 74 }
108 ]; 75 }, {
76 header: 'OK-Flag',
77 dataIndex: "fertig",
78 renderer: function(value) {
79 if (value) {
80 return "Ja";
81 } else {
82 return "Nein";
83 }
84 }
85 }, {
86 header: 'Anzahl Nuklide',
87 dataIndex: 'id',
88 renderer: function(value) {
89 var mstore = Ext.getStore('Messwerte');
90 mstore.load({
91 params: {
92 probeId: value.probeId,
93 messungsId: value.id
94 }
95 });
96 return mstore.getTotalCount();
97 }
98 }, {
99 header: 'Anzahl Kommentare',
100 flex: 1,
101 dataIndex: 'id',
102 renderer: function(value) {
103 var kstore = Ext.getStore('KommentareM');
104 kstore.load({
105 params: {
106 probeId: value.probeId,
107 messungsId: value.id
108 }
109 });
110 return kstore.getTotalCount();
111 }
112 }];
109 this.callParent(arguments); 113 this.callParent(arguments);
110 } 114 }
111 }); 115 });
112 116

http://lada.wald.intevation.org