comparison app/model/MKommentar.js @ 161:0b635b836903

Added model and store for Messungskommentare.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 03 Jul 2013 14:00:55 +0200
parents
children f1f0351b6e2f
comparison
equal deleted inserted replaced
160:c932b0b41d2a 161:0b635b836903
1 Ext.define('Lada.model.MKommentar', {
2 extend: 'Ext.data.Model',
3 fields: [
4 {name: "kId"},
5 {name: "messungsId"},
6 {name: "probeId"},
7 {name: "erzeuger"},
8 {name: "kdatum", type: 'date', convert: ts2date, defaultValue: new Date()},
9 {name: "ktext"}
10 ],
11 idProperty: "kId",
12 proxy: {
13 type: 'rest',
14 appendId: true, //default
15 url: 'server/rest/messkommentare',
16 reader: {
17 type: 'json',
18 root: 'data'
19 }
20 },
21 getEidi: function() {
22 var kid = this.get('kId');
23 var messId = this.get('messungsId');
24 var probeId = this.get('probeId');
25 return "/" + kid + "/" + messId + "/" + probeId;
26 }
27 });
28
29 function ts2date(v, record){
30 // Converts a timestamp into a date object.
31 return new Date(v);
32 }

http://lada.wald.intevation.org