view app/view/messungen/List.js @ 438:90a09317f8d1

Removed obsolete fields from probe model.
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 02 Dec 2013 15:02:17 +0100
parents d1bb925bb5f5
children 7e73478780fe
line wrap: on
line source
/*
 * Grid to list Messungen
 */
Ext.define('Lada.view.messungen.List' ,{
    extend: 'Ext.grid.Panel',
    alias: 'widget.messungenlist',
    store: 'Messungen',
    viewConfig: {
        maxHeight: 350,
        emptyText: 'Keine Messungen gefunden.',
        // minHeight and deferEmptyText are needed to be able to show the
        // emptyText message.
        minHeight: 35,
        deferEmptyText: false
    },
    probeId: null,
    initComponent: function() {
        this.dockedItems = [
            {
                xtype: 'toolbar',
                dock: 'top',
                items: [
                    {
                        text: 'Hinzufügen',
                        icon: 'gfx/list-add.png',
                        action: 'add',
                        probeId: this.probeId
                    },
                    {
                        text: 'Löschen',
                        icon: 'gfx/list-remove.png',
                        action: 'delete'
                    }
                ]
            }
        ];
        this.columns = [
            {header: 'Mess.ID', dataIndex: "messungsId", width: 50},
            {header: 'NPR-Nr.', dataIndex: "nebenprobenNr", width: 50},
            {header: 'MMT', dataIndex: "mmtId", width: 50},
            {header: 'Messzeit', dataIndex: "messzeitpunkt"},
            {
                header: 'Status',
                dataIndex: 'id',
                renderer: function(value) {
                    var sstore = Ext.getStore('Status');
                    sstore.load({
                        params: {
                            probeId: value.probeId,
                            messungsId: value.messungsId
                        }
                    });
                    if (sstore.getTotalCount() === 0) {
                        return "unbekannt";
                    } else {
                        return sstore.last().get('status');
                    }
                }
            },
            {header: 'OK-Flag', dataIndex: "fertig"},
            {
                header: 'Anzahl Nuklide',
                dataIndex: 'id',
                renderer: function(value) {
                    var mstore = Ext.getStore('Messwerte');
                    mstore.load({
                        params: {
                            probeId: value.probeId,
                            messungsId: value.messungsId
                        }
                    });
                    return mstore.getTotalCount();
                }
            },
            {
                header: 'Anzahl Kommentare',
                flex: 1,
                dataIndex: 'id',
                renderer: function(value) {
                    var kstore = Ext.getStore('MKommentare');
                    kstore.load({
                        params: {
                            probeId: value.probeId,
                            messungsId: value.messungsId
                        }
                    });
                    return kstore.getTotalCount();
                }
            }
        ];
        this.callParent(arguments);
    }
});

http://lada.wald.intevation.org