comparison app/model/Zusatzwert.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
10 * Model class for Zusatzwerte 10 * Model class for Zusatzwerte
11 */ 11 */
12 Ext.define('Lada.model.Zusatzwert', { 12 Ext.define('Lada.model.Zusatzwert', {
13 extend: 'Lada.model.Base', 13 extend: 'Lada.model.Base',
14 fields: [ 14 fields: [
15 {name: "id"},
16 {name: "probeId"},
15 {name: "pzsId"}, 17 {name: "pzsId"},
16 {name: "probeId"},
17 {name: "nwgZuMesswert", type: 'float'}, 18 {name: "nwgZuMesswert", type: 'float'},
18 {name: "messwertPzs", type: 'float'}, 19 {name: "messwertPzs", type: 'float'},
19 {name: "messfehler", type: 'float'}, 20 {name: "messfehler", type: 'float'},
20 {name: "letzteAenderung", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()} 21 {name: "letzteAenderung", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}
21 ], 22 ],
22 idProperty: "pzsId", 23 idProperty: "id",
23 proxy: { 24 proxy: {
24 type: 'rest', 25 type: 'rest',
25 appendId: true, //default
26 url: 'server/rest/zusatzwert', 26 url: 'server/rest/zusatzwert',
27 reader: { 27 reader: {
28 type: 'json', 28 type: 'json',
29 root: 'data' 29 root: 'data'
30 }, 30 },
33 // TODO: Check if this function is really needed (torsten) 33 // TODO: Check if this function is really needed (torsten)
34 // <2013-09-18 15:58> 34 // <2013-09-18 15:58>
35 writeEverything : true 35 writeEverything : true
36 } 36 }
37 }, 37 },
38 getEidi: function () {
39 var pzsId = this.get('pzsId');
40 var probeId = this.get('probeId');
41 return "/" + pzsId + "/" + probeId;
42 },
43 getMesseinheit: function(pzsId) { 38 getMesseinheit: function(pzsId) {
44 var zstore = Ext.getStore('Probenzusatzwerte'); 39 var zstore = Ext.getStore('StaProbenzusaetze');
45 var mstore = Ext.getStore('Messeinheit'); 40 var mstore = Ext.getStore('StaMesseinheiten');
46 var mehId = zstore.getById(pzsId).get('mehId'); 41 var mehId = zstore.getById(pzsId).get('mehId');
47 var record = mstore.findRecord('mehId', mehId); 42 console.log('mehid: ' + mehId);
43 var record = mstore.getById(mehId);
48 return record.get('einheit'); 44 return record.get('einheit');
49 } 45 }
50 }); 46 });

http://lada.wald.intevation.org