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@502: * the documentation coming with IMIS-Labordaten-Application for details. torsten@472: */ torsten@472: torsten@343: /* torsten@343: * Grid to list Messungen torsten@343: */ raimund@502: Ext.define('Lada.view.messungen.List', { torsten@103: extend: 'Ext.grid.Panel', torsten@103: alias: 'widget.messungenlist', raimund@491: torsten@103: store: 'Messungen', torsten@103: viewConfig: { torsten@103: maxHeight: 350, torsten@103: emptyText: 'Keine Messungen gefunden.', torsten@103: // minHeight and deferEmptyText are needed to be able to show the torsten@103: // emptyText message. torsten@103: minHeight: 35, torsten@103: deferEmptyText: false torsten@103: }, raimund@491: torsten@172: probeId: null, raimund@491: torsten@103: 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: 'Mess.ID', raimund@502: dataIndex: 'id', raimund@491: width: 50 raimund@491: }, { raimund@491: header: 'NPR-Nr.', raimund@502: dataIndex: 'nebenprobenNr', raimund@491: width: 50 raimund@491: }, { raimund@491: header: 'MMT', raimund@502: dataIndex: 'mmtId', raimund@491: width: 50 raimund@491: }, { raimund@491: header: 'Messzeit', raimund@502: dataIndex: 'messzeitpunkt' raimund@491: }, { raimund@491: header: 'Status', raimund@491: dataIndex: 'id', raimund@502: width: 50, raimund@491: renderer: function(value) { raimund@491: var sstore = Ext.getStore('Status'); raimund@491: sstore.load({ raimund@491: params: { raimund@491: probeId: value.probeId, raimund@491: messungsId: value.id torsten@103: } raimund@491: }); raimund@491: if (sstore.getTotalCount() === 0) { raimund@502: return 'unbekannt'; torsten@164: } raimund@502: return sstore.last().get('status'); torsten@164: } raimund@491: }, { raimund@491: header: 'OK-Flag', raimund@502: dataIndex: 'fertig', raimund@502: width: 50, raimund@491: renderer: function(value) { raimund@491: if (value) { raimund@502: return 'Ja'; raimund@491: } raimund@502: return 'Nein'; raimund@491: } raimund@491: }, { raimund@491: header: 'Anzahl Nuklide', raimund@491: dataIndex: 'id', raimund@491: renderer: function(value) { raimund@491: var mstore = Ext.getStore('Messwerte'); raimund@491: mstore.load({ raimund@491: params: { raimund@491: probeId: value.probeId, raimund@491: messungsId: value.id raimund@491: } raimund@491: }); raimund@491: return mstore.getTotalCount(); raimund@491: } raimund@491: }, { raimund@491: header: 'Anzahl Kommentare', raimund@491: flex: 1, raimund@491: dataIndex: 'id', raimund@491: renderer: function(value) { raimund@491: var kstore = Ext.getStore('KommentareM'); raimund@491: kstore.load({ raimund@491: params: { raimund@491: probeId: value.probeId, raimund@491: messungsId: value.id raimund@491: } raimund@491: }); raimund@491: return kstore.getTotalCount(); raimund@491: } raimund@491: }]; torsten@103: this.callParent(arguments); torsten@103: } torsten@103: });