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 raimund@497: * the documentation coming with IMIS-Labordaten-Application for details. torsten@472: */ torsten@472: torsten@345: /* torsten@345: * Grid to list Messwerte torsten@345: */ raimund@497: Ext.define('Lada.view.messwerte.List', { torsten@183: extend: 'Ext.grid.Panel', torsten@183: alias: 'widget.messwertelist', raimund@491: torsten@183: store: 'Messwerte', torsten@183: viewConfig: { torsten@183: maxHeight: 350, torsten@183: emptyText: 'Keine Messwerte gefunden.', torsten@183: // minHeight and deferEmptyText are needed to be able to show the torsten@183: // emptyText message. torsten@183: minHeight: 35, torsten@183: deferEmptyText: false torsten@183: }, raimund@491: torsten@183: probeId: null, torsten@210: parentId: null, raimund@491: torsten@183: initComponent: function() { raimund@491: this.dockedItems = [{ raimund@491: xtype: 'toolbar', raimund@513: dock: 'bottom', raimund@513: items: ['->', { raimund@491: text: 'Hinzufügen', raimund@491: icon: 'gfx/list-add.png', raimund@491: action: 'add', raimund@491: probeId: this.probeId, raimund@491: parentId: this.parentId 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: '<NWG', raimund@491: dataIndex: 'messwertNwg' raimund@491: }, { raimund@491: header: 'Messwert', raimund@491: dataIndex: 'messwert' raimund@491: }, { raimund@491: header: 'Messfehler', raimund@491: dataIndex: 'messfehler' raimund@491: }, { raimund@491: header: 'Messgröße', raimund@491: dataIndex: 'messgroesseId', raimund@491: renderer: function(value) { raimund@496: var store = Ext.data.StoreManager.get('staMessgroessen'); raimund@491: return store.findRecord('id', value).get('messgroesse'); torsten@183: } raimund@491: }, { raimund@491: header: 'Messeinheit', raimund@491: dataIndex: 'mehId', raimund@491: renderer: function(value) { raimund@496: var store = Ext.data.StoreManager.get('staMesseinheiten'); raimund@491: return store.findRecord('id', value).get('einheit'); raimund@491: } raimund@491: }, { raimund@491: header: 'Grenzwertüberschreitung', raimund@491: dataIndex: 'grenzwertueberschreitung', raimund@491: flex: 1, raimund@491: renderer: function(value) { raimund@491: if (value === true) { raimund@497: return 'Ja'; torsten@183: } raimund@497: return 'Nein'; torsten@183: } raimund@491: }]; torsten@183: this.callParent(arguments); torsten@183: } torsten@183: });