view app/model/Kommentar.js @ 252:1bce2d59b7e9

Update description and sql statement when chosing another query
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 24 Jul 2013 15:24:23 +0200
parents 7b1140bd8b3d
children 53a446d4f424
line wrap: on
line source
Ext.define('Lada.model.Kommentar', {
    extend: 'Ext.data.Model',
    fields: [
        {name: "kId"},
        {name: "probeId"},
        {name: "erzeuger"},
        {name: "kdatum", type: 'date', convert: 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;
    }
});

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

http://lada.wald.intevation.org