comparison app/model/Messung.js @ 488:f7446ebfe5d0

Added and updated models.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 31 Oct 2014 21:10:35 +0100
parents debfcc7713e3
children 850ccfe5f3c4
comparison
equal deleted inserted replaced
487:a05cbc6e63cb 488:f7446ebfe5d0
11 */ 11 */
12 Ext.define('Lada.model.Messung', { 12 Ext.define('Lada.model.Messung', {
13 extend: 'Lada.model.Base', 13 extend: 'Lada.model.Base',
14 fields: [ 14 fields: [
15 {name: "id"}, 15 {name: "id"},
16 {name: "messungsId", mapping:"id.messungsId"}, 16 {name: "messungsId"},
17 {name: "probeId", mapping:"id.probeId"}, 17 {name: "probeId"},
18 {name: "mmtId"}, 18 {name: "mmtId"},
19 {name: "nebenprobenNr"}, 19 {name: "nebenprobenNr"},
20 {name: "messdauer"}, 20 {name: "messdauer"},
21 {name: "messzeitpunkt", convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, 21 {name: "messzeitpunkt", convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
22 {name: "fertig", type: "boolean"}, 22 {name: "fertig", type: "boolean"},
24 {name: "geplant", type: "boolean"} 24 {name: "geplant", type: "boolean"}
25 ], 25 ],
26 idProperty: "id", 26 idProperty: "id",
27 proxy: { 27 proxy: {
28 type: 'rest', 28 type: 'rest',
29 appendId: true, //default
30 url: 'server/rest/messung', 29 url: 'server/rest/messung',
31 reader: { 30 reader: {
32 type: 'json', 31 type: 'json',
33 root: 'data' 32 root: 'data'
34 } 33 }
35 },
36 getEidi: function() {
37 var messId = this.get('messungsId');
38 var probeId = this.get('probeId');
39 return "/" + messId + "/" + probeId;
40 } 34 }
41 }); 35 });
42
43 function ts2date(v, record){
44 // Converts a timestamp into a date object.
45 return new Date(v);
46 }

http://lada.wald.intevation.org