comparison app/view/messwerte/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 d07e5086a64b
comparison
equal deleted inserted replaced
490:446e99cfd425 491:850ccfe5f3c4
11 */ 11 */
12 Ext.define('Lada.view.messwerte.List' ,{ 12 Ext.define('Lada.view.messwerte.List' ,{
13 extend: 'Ext.grid.Panel', 13 extend: 'Ext.grid.Panel',
14 require: ['Lada.store.StaMesseinheit'], 14 require: ['Lada.store.StaMesseinheit'],
15 alias: 'widget.messwertelist', 15 alias: 'widget.messwertelist',
16
16 store: 'Messwerte', 17 store: 'Messwerte',
17 viewConfig: { 18 viewConfig: {
18 maxHeight: 350, 19 maxHeight: 350,
19 emptyText: 'Keine Messwerte gefunden.', 20 emptyText: 'Keine Messwerte gefunden.',
20 // minHeight and deferEmptyText are needed to be able to show the 21 // minHeight and deferEmptyText are needed to be able to show the
21 // emptyText message. 22 // emptyText message.
22 minHeight: 35, 23 minHeight: 35,
23 deferEmptyText: false 24 deferEmptyText: false
24 }, 25 },
26
25 probeId: null, 27 probeId: null,
26 parentId: null, 28 parentId: null,
29
27 initComponent: function() { 30 initComponent: function() {
28 this.dockedItems = [ 31 this.dockedItems = [{
29 { 32 xtype: 'toolbar',
30 xtype: 'toolbar', 33 dock: 'top',
31 dock: 'top', 34 items: [{
32 items: [ 35 text: 'Hinzufügen',
33 { 36 icon: 'gfx/list-add.png',
34 text: 'Hinzufügen', 37 action: 'add',
35 icon: 'gfx/list-add.png', 38 probeId: this.probeId,
36 action: 'add', 39 parentId: this.parentId
37 probeId: this.probeId, 40 }, {
38 parentId: this.parentId 41 text: 'Löschen',
39 }, 42 icon: 'gfx/list-remove.png',
40 { 43 action: 'delete'
41 text: 'Löschen', 44 }]
42 icon: 'gfx/list-remove.png', 45 }];
43 action: 'delete' 46 this.columns = [{
44 } 47 header: '&lt;NWG',
45 ] 48 dataIndex: 'messwertNwg'
49 }, {
50 header: 'Messwert',
51 dataIndex: 'messwert'
52 }, {
53 header: 'Messfehler',
54 dataIndex: 'messfehler'
55 }, {
56 header: 'Messgröße',
57 dataIndex: 'messgroesseId',
58 renderer: function(value) {
59 var store = Ext.getStore('StaMessgroessen');
60 return store.findRecord('id', value).get('messgroesse');
46 } 61 }
47 ]; 62 }, {
48 this.columns = [ 63 header: 'Messeinheit',
49 { 64 dataIndex: 'mehId',
50 header: '&lt;NWG', 65 renderer: function(value) {
51 dataIndex: 'messwertNwg' 66 console.log('einheit: ' + value);
52 }, 67 var store = Ext.data.StoreManager.get('StaMesseinheiten');
53 { 68 /* if (!store) {
54 header: 'Messwert', 69 store = Ext.create('Lada.store.StaMesseinheiten');
55 dataIndex: 'messwert'
56 },
57 {header: 'Messfehler', dataIndex: 'messfehler'},
58 {
59 header: 'Messgröße',
60 dataIndex: 'messgroesseId',
61 renderer: function(value) {
62 var store = Ext.getStore('StaMessgroessen');
63 return store.findRecord('id', value).get('messgroesse');
64 } 70 }
65 },
66 {
67 header: 'Messeinheit',
68 dataIndex: 'mehId',
69 renderer: function(value) {
70 console.log('einheit: ' + value);
71 var store = Ext.data.StoreManager.get('StaMesseinheiten');
72 /* if (!store) {
73 store = Ext.create('Lada.store.StaMesseinheiten');
74 }
75 */ console.log(store.getById(value)); 71 */ console.log(store.getById(value));
76 return store.findRecord('id', value).get('einheit'); 72 return store.findRecord('id', value).get('einheit');
77 } 73 }
78 }, 74 }, {
79 { 75 header: 'Grenzwertüberschreitung',
80 header: 'Grenzwertüberschreitung', 76 dataIndex: 'grenzwertueberschreitung',
81 dataIndex: 'grenzwertueberschreitung', 77 flex: 1,
82 flex: 1, 78 renderer: function(value) {
83 renderer: function(value) { 79 if (value === true) {
84 if (value === true) { 80 return "Ja";
85 return "Ja"; 81 } else {
86 } else { 82 return "Nein";
87 return "Nein";
88 }
89 } 83 }
90 } 84 }
91 ]; 85 }];
92 this.callParent(arguments); 86 this.callParent(arguments);
93 } 87 }
94 }); 88 });
95 89

http://lada.wald.intevation.org