view app/model/Messung.js @ 142:dee9da79f055

Added function to model with return the beschreibung of the messeinheit of a given Probenzusatzwert by pzsId.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 28 Jun 2013 11:15:39 +0200
parents 3552b0ee4526
children 237a4efe715a
line wrap: on
line source
Ext.define('Lada.model.Messung', {
    extend: 'Ext.data.Model',
        fields: [
        {name: "id"},
        {name: "messungsId", mapping: "id.messungsId"},
        {name: "convertedId", convert: buildId},
        {name: "lprobeId"},
        {name: "mmtId"},
        {name: "nebenprobenNr"},
        {name: "messdauer"},
        {name: "messzeitpunkt"},
        {name: "fertig", type: "boolean"},
        {name: "letzteAenderung", type:"date"},
        {name: "geplant", type: "boolean"}
    ],
    idProperty: "convertedId",
    proxy: {
        type: 'rest',
        appendId: true, //default
        url: 'server/rest/messung',
        reader: {
            type: 'json',
            root: 'data'
        }
    }
});

function buildId(v, record){
    return record.get('probeId') + record.get('messungsId');
}

http://lada.wald.intevation.org