comparison app/view/grid/Probenzusatzwert.js @ 559:9a414a49dffe

Updated probenuzsatzwert grid columns and editors.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 06 Mar 2015 17:05:32 +0100
parents d47ee7439f44
children 1dedce48e3e1
comparison
equal deleted inserted replaced
558:9d4e4f07e751 559:9a414a49dffe
34 this.plugins = [rowEditing]; 34 this.plugins = [rowEditing];
35 this.dockedItems = [{ 35 this.dockedItems = [{
36 xtype: 'toolbar', 36 xtype: 'toolbar',
37 dock: 'bottom', 37 dock: 'bottom',
38 items: ['->', { 38 items: ['->', {
39 text: 'Details',
40 icon: 'resources/img/document-open.png',
41 action: 'open',
42 disabled: true
43 }, {
44 text: 'Hinzufügen', 39 text: 'Hinzufügen',
45 icon: 'resources/img/list-add.png', 40 icon: 'resources/img/list-add.png',
46 action: 'add', 41 action: 'add',
47 probeId: this.probeId 42 probeId: this.probeId
48 }, { 43 }, {
52 }] 47 }]
53 }]; 48 }];
54 this.columns = [{ 49 this.columns = [{
55 header: 'PZW-ID', 50 header: 'PZW-ID',
56 dataIndex: 'id', 51 dataIndex: 'id',
57 editor: { 52 width: 70
58 xtype: 'numberfield',
59 allowBlank: false
60 }
61 }, { 53 }, {
62 header: 'PZW-Größe', 54 header: 'PZW-Größe',
63 dataIndex: 'pzsId', 55 dataIndex: 'pzsId',
56 flex: 1,
64 renderer: function(value) { 57 renderer: function(value) {
65 var store = Ext.data.StoreManager.get('probenzusaetze'); 58 var store = Ext.data.StoreManager.get('probenzusaetze');
66 var record = store.getById(value); 59 var record = store.getById(value);
67 return record.get('beschreibung'); 60 return record.get('beschreibung');
68 }, 61 },
69 flex: 1,
70 editor: { 62 editor: {
71 xtype: 'probenzusatzwert' 63 xtype: 'combobox',
64 store: Ext.data.StoreManager.get('probenzusaetze'),
65 displayField: 'beschreibung',
66 valueField: 'id',
67 allowBlank: false
72 } 68 }
73 }, { 69 }, {
74 header: 'Messwert', 70 header: 'Messwert',
75 dataIndex: 'id', 71 dataIndex: 'messwertPzs',
72 width: 80,
73 renderer: function(value, meta, record) {
74 var nwg = record.get('nwgZuMesswert');
75 if (value < nwg) {
76 return '<' + value;
77 }
78 return value;
79 },
80 editor: {
81 allowBlank: false
82 }
83 }, {
84 header: 'Maßeinheit',
85 dataIndex: 'pzsId',
86 width: 80,
76 renderer: function(value) { 87 renderer: function(value) {
77 var record = this.store.getById(value); 88 var zstore = Ext.data.StoreManager.get('probenzusaetze');
78 var messwert = record.get('messwertPzs'); 89 var mstore = Ext.data.StoreManager.get('messeinheiten');
79 var nwg = record.get('nwgZuMesswert'); 90 var mehId = zstore.getById(value).get('mehId');
80 if (messwert < nwg) { 91 var record = mstore.findRecord('id', mehId);
81 return '<' + messwert; 92 return record.get('einheit');
82 } 93 }
83 return messwert; 94 }, {
95 header: 'Nachweisgrenze',
96 dataIndex: 'nwgZuMesswert',
97 width: 110,
98 editor: {
99 allowBlank: false
84 } 100 }
85 }, { 101 }, {
86 header: 'rel. Unsich.[%]', 102 header: 'rel. Unsich.[%]',
87 dataIndex: 'messfehler', 103 dataIndex: 'messfehler',
88 editor: { 104 editor: {
89 allowBlank: false 105 allowBlank: false
90 }
91 }, {
92 header: 'Maßeinheit',
93 dataIndex: 'pzsId',
94 renderer: function(value) {
95 var zstore = Ext.data.StoreManager.get('probenzusaetze');
96 var mstore = Ext.data.StoreManager.get('messeinheiten');
97 var mehId = zstore.getById(value).get('mehId');
98 var record = mstore.findRecord('id', mehId);
99 return record.get('einheit');
100 } 106 }
101 }]; 107 }];
102 this.initData(); 108 this.initData();
103 this.callParent(arguments); 109 this.callParent(arguments);
104 }, 110 },

http://lada.wald.intevation.org