torsten@472: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz torsten@472: * Software engineering by Intevation GmbH torsten@472: * torsten@472: * This file is Free Software under the GNU GPL (v>=3) torsten@472: * and comes with ABSOLUTELY NO WARRANTY! Check out torsten@472: * the documentation coming with IMIS-Labordaten-Application for details. torsten@472: */ torsten@472: torsten@351: /* torsten@351: * Grid to list Probenzusatzwerte torsten@351: */ torsten@106: Ext.define('Lada.view.zusatzwerte.List' ,{ torsten@106: extend: 'Ext.grid.Panel', torsten@106: alias: 'widget.zusatzwertelist', raimund@491: torsten@106: store: 'Zusatzwerte', torsten@106: viewConfig: { torsten@106: maxHeight: 350, torsten@106: emptyText: 'Keine Zusatzwerte gefunden.', torsten@106: // minHeight and deferEmptyText are needed to be able to show the torsten@106: // emptyText message. torsten@106: minHeight: 35, torsten@106: deferEmptyText: false torsten@106: }, raimund@491: torsten@125: probeId: null, raimund@491: torsten@106: initComponent: function() { raimund@491: this.dockedItems = [{ raimund@491: xtype: 'toolbar', raimund@491: dock: 'top', raimund@491: items: [{ raimund@491: text: 'Hinzufügen', raimund@491: icon: 'gfx/list-add.png', raimund@491: action: 'add', raimund@491: probeId: this.probeId raimund@491: }, { raimund@491: text: 'Löschen', raimund@491: icon: 'gfx/list-remove.png', raimund@491: action: 'delete' raimund@491: }] raimund@491: }]; raimund@491: this.columns = [{ raimund@491: header: 'PZW-ID', raimund@491: dataIndex: 'id' raimund@491: }, { raimund@491: header: 'PZW-Größe', raimund@491: dataIndex: 'pzsId', raimund@491: renderer: function(value) { raimund@491: var store = Ext.getStore('StaProbenzusaetze'); raimund@491: var record = store.getById(value); raimund@491: return record.get('beschreibung'); torsten@123: }, raimund@491: flex: 1 raimund@491: }, { raimund@491: header: 'Messwert', raimund@491: dataIndex: 'id', raimund@491: renderer: function(value) { raimund@491: var store = Ext.getStore('Zusatzwerte'); raimund@491: var record = store.getById(value); raimund@491: var messwert = record.get('messwertPzs'); raimund@491: var nwg = record.get('nwgZuMesswert'); raimund@491: if (messwert < nwg ) { raimund@491: return "<"+messwert; raimund@491: } else { raimund@491: return messwert; torsten@123: } torsten@123: } raimund@491: }, { raimund@491: header: 'rel. Unsich.[%]', raimund@491: dataIndex: 'messfehler' raimund@491: }, { raimund@491: header: 'Maßeinheit', raimund@491: dataIndex: 'pzsId', raimund@491: renderer: function(value) { raimund@491: var zstore = Ext.getStore('StaProbenzusaetze'); raimund@491: var mstore = Ext.getStore('StaMesseinheiten'); raimund@491: console.log('store: ' + mstore); raimund@491: var mehId = zstore.getById(value).get('mehId'); raimund@491: var record = mstore.findRecord('id', mehId); raimund@491: return record.get('einheit'); raimund@491: } raimund@491: }]; torsten@106: this.callParent(arguments); torsten@106: } torsten@106: });