comparison app/model/Zusatzwert.js @ 309:51897f9a6bbb

Use ts2date function from lib.Helpers. Remove old code
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 09 Aug 2013 15:24:00 +0200
parents dee9da79f055
children 83db862d0f3f
comparison
equal deleted inserted replaced
308:59c1d9ad6555 309:51897f9a6bbb
1 Ext.define('Lada.model.Zusatzwert', { 1 Ext.define('Lada.model.Zusatzwert', {
2 extend: 'Ext.data.Model', 2 extend: 'Ext.data.Model',
3 requires: ['Lada.lib.Helpers'],
3 fields: [ 4 fields: [
4 {name: "pzsId"}, 5 {name: "pzsId"},
5 {name: "probeId"}, 6 {name: "probeId"},
6 {name: "nwgZuMesswert", type: 'float'}, 7 {name: "nwgZuMesswert", type: 'float'},
7 {name: "messwertPzs", type: 'float'}, 8 {name: "messwertPzs", type: 'float'},
8 {name: "messfehler", type: 'float'}, 9 {name: "messfehler", type: 'float'},
9 {name: "letzteAenderung", type: 'date', convert: ts2date, defaultValue: new Date()} 10 {name: "letzteAenderung", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}
10 ], 11 ],
11 idProperty: "pzsId", 12 idProperty: "pzsId",
12 proxy: { 13 proxy: {
13 type: 'rest', 14 type: 'rest',
14 appendId: true, //default 15 appendId: true, //default
33 var mehId = zstore.getById(pzsId).get('mehId'); 34 var mehId = zstore.getById(pzsId).get('mehId');
34 var record = mstore.findRecord('mehId', mehId); 35 var record = mstore.findRecord('mehId', mehId);
35 return record.get('einheit'); 36 return record.get('einheit');
36 } 37 }
37 }); 38 });
38
39 function buildId(v, record){
40 return record.get('probeId') + ',' + record.get('pzsId');
41 }
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