Mercurial > lada > lada-client
view app/model/MKommentar.js @ 194:5d72d74a2daf
Added function to save a Messung.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Mon, 08 Jul 2013 14:26:05 +0200 |
parents | f1f0351b6e2f |
children | 8970cbad6cae |
line wrap: on
line source
Ext.define('Lada.model.MKommentar', { extend: 'Ext.data.Model', fields: [ {name: "id"}, {name: "messungsId"}, {name: "probeId"}, {name: "erzeuger"}, {name: "kdatum", type: 'date', convert: ts2date, defaultValue: new Date()}, {name: "ktext"} ], idProperty: "id", proxy: { type: 'rest', appendId: true, //default url: 'server/rest/messkommentare', reader: { type: 'json', root: 'data' } }, getEidi: function() { var kid = this.get('id.kid'); var messId = this.get('messungsId'); var probeId = this.get('probeId'); return "/" + kid + "/" + messId + "/" + probeId; } }); function ts2date(v, record){ // Converts a timestamp into a date object. return new Date(v); }