comparison app/model/Messung.js @ 212:92facbaece42

add getEidi function to model
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 12 Jul 2013 15:57:09 +0200
parents c5422819d7b9
children fe199b8828a8
comparison
equal deleted inserted replaced
211:401d559e0461 212:92facbaece42
5 {name: "messungsId", mapping:"id.messungsId"}, 5 {name: "messungsId", mapping:"id.messungsId"},
6 {name: "probeId", mapping:"id.probeId"}, 6 {name: "probeId", mapping:"id.probeId"},
7 {name: "mmtId"}, 7 {name: "mmtId"},
8 {name: "nebenprobenNr"}, 8 {name: "nebenprobenNr"},
9 {name: "messdauer"}, 9 {name: "messdauer"},
10 {name: "messzeitpunkt", convert: ts2date}, 10 {name: "messzeitpunkt", convert: ts2date, defaultValue: new Date()},
11 {name: "fertig", type: "boolean"}, 11 {name: "fertig", type: "boolean"},
12 {name: "letzteAenderung", type:"date"}, 12 {name: "letzteAenderung", type:"date"},
13 {name: "geplant", type: "boolean"} 13 {name: "geplant", type: "boolean"}
14 ], 14 ],
15 idProperty: "convertedId", 15 idProperty: "id",
16 proxy: { 16 proxy: {
17 type: 'rest', 17 type: 'rest',
18 appendId: true, //default 18 appendId: true, //default
19 url: 'server/rest/messung', 19 url: 'server/rest/messung',
20 reader: { 20 reader: {
21 type: 'json', 21 type: 'json',
22 root: 'data' 22 root: 'data'
23 } 23 }
24 },
25 getEidi: function() {
26 var messId = this.get('messungsId');
27 var probeId = this.get('probeId');
28 return "/" + messId + "/" + probeId;
24 } 29 }
25 }); 30 });
26 31
27 function ts2date(v, record){ 32 function ts2date(v, record){
28 // Converts a timestamp into a date object. 33 // Converts a timestamp into a date object.

http://lada.wald.intevation.org