view app/view/zusatzwerte/CreateForm.js @ 271:11f8a2c1b610

Added Cancel Button to all Windows. Changed order howthe form is initialized. Now the form could hide the buttuns in the parent window depending on the readonly flag.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 06 Aug 2013 16:03:38 +0200
parents 62b757ccdd8f
children d6d74718a102
line wrap: on
line source
Ext.define('Lada.view.zusatzwerte.CreateForm', {
    extend: 'Lada.view.widgets.LadaForm',
    requires : [
        'Lada.view.widgets.Probenzusatzwert'
    ],
    model: 'Lada.model.Zusatzwert',
    initComponent: function() {
        this.items = [
            {
                xtype: 'probenzusatzwert',
                name: 'pzsId',
                fieldLabel: 'PZW-Größe',
                listeners: {
                    scope: this,
                    'change': function (field, newv, oldv, opts) {
                        console.log(field, oldv, newv, opts);
                        var ffield = this.getForm().findField("messeinheit");
                        pzsId = newv;
                        if (pzsId == undefined) {
                            pzsId = oldv;
                        }
                        ffield.setValue(this.model.getMesseinheit(pzsId));
                    }
                }
            },
            {
                layout: "column",
                border: 0,
                items: [
                    {
                        xtype: 'textfield',
                        name: 'messwertPzs',
                        fieldLabel: 'Messwert'
                    },
                    {
                        xtype: 'displayfield',
                        name: 'messeinheit'
                    }
                ]
            },
            {
                xtype: 'textfield',
                name: 'messfehler',
                fieldLabel: 'rel. Unsich.[%]'
            },
            {
                xtype: 'textfield',
                name: 'nwgZuMesswert',
                fieldLabel: 'Nachweisgrenze'
            }
        ];
        this.callParent();
    }
});

http://lada.wald.intevation.org