view app/model/Kommentar.js @ 304:8475a625a773

Use ts2date function from lib.Helpers. Remove old code
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 09 Aug 2013 15:24:00 +0200
parents 53a446d4f424
children fcbd60412ba8
line wrap: on
line source
Ext.define('Lada.model.Kommentar', {
    extend: 'Ext.data.Model',
    requires: ['Lada.lib.Helpers'],
    fields: [
        {name: "kId"},
        {name: "probeId"},
        {name: "erzeuger"},
        {name: "kdatum", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
        {name: "ktext"}
    ],
    idProperty: "kId",
    proxy: {
        type: 'rest',
        appendId: true, //default
        url: 'server/rest/kommentare',
        reader: {
            type: 'json',
            root: 'data'
        }
    },
    getEidi: function() {
        var kid =  this.get('kId');
        var probeId = this.get('probeId');
        return "/" + kid + "/" + probeId;
    }
});

http://lada.wald.intevation.org