view app/model/Ortdetail.js @ 227:d3f4a39bf89e

Set IdProperty and fix creating and updating mkommentar
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 17 Jul 2013 10:58:03 +0200
parents 16ba7e2465fd
children c7f0bf80761b
line wrap: on
line source
Ext.define('Lada.model.Ortdetail', {
    extend: 'Ext.data.Model',
    fields: [
        {name: "ortId"},
        {name: "bezeichnung"},
        {name: "beschreibung"},
        {name: "unscharf"},
        {name: "nutsCode"},
        {name: "koordXExtern"},
        {name: "koordYExtern"},
        {name: "hoeheLand"},
        {name: "letzteAenderung", type: 'date', convert: ts2date, defaultValue: new Date()},
        {name: "longitude", type: 'float'},
        {name: "latitude", type: 'float'},
        {name: "staatId"},
        {name: "gemId"},
        {name: "otyp"}
    ],
    idProperty: "ortId",
    proxy: {
        type: 'rest',
        appendId: true, //default
        url: 'server/rest/ortinfo',
        api: {
        },
        reader: {
            type: 'json',
            root: 'data'
        }
    }
});

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

http://lada.wald.intevation.org