view app/model/Status.js @ 224:5e056c5edf9a

Fixed loading stores when editing Messung.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 16 Jul 2013 13:56:38 +0200
parents 8e41a5a6cb7f
children d27017394c8f
line wrap: on
line source
Ext.define('Lada.model.Status', {
    extend: 'Ext.data.Model',
    fields: [
        {name: "sid"},
        {name: "messungsId"},
        {name: "probeId"},
        {name: "erzeuger"},
        {name: "status", defaultValue: 1},
        {name: "sdatum", type: 'date', convert: ts2date, defaultValue: new Date()},
        {name: "skommentar"}
    ],
    idProperty: "sId",
    proxy: {
        type: 'rest',
        appendId: true, //default
        url: 'server/rest/status',
        reader: {
            type: 'json',
            root: 'data'
        }
    },
    getEidi: function() {
        var sid =  this.get('sid');
        var messId = this.get('messungsId');
        var probeId = this.get('probeId');
        return "/" + sid + "/" + messId + "/" + probeId;
    }
});

function ts2date(v, record){
    // Converts a timestamp into a date object.
    return new Date(v);
}

http://lada.wald.intevation.org