Mercurial > lada > lada-client
comparison app/model/Probe.js @ 104:e9643b7c103c
[mq]: craftid
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Tue, 18 Jun 2013 12:40:11 +0200 |
parents | b6a05fe9f40e |
children | fe4a1ee15418 |
comparison
equal
deleted
inserted
replaced
103:3552b0ee4526 | 104:e9643b7c103c |
---|---|
1 Ext.define('Lada.model.Probe', { | 1 Ext.define('Lada.model.Probe', { |
2 extend: 'Ext.data.Model', | 2 extend: 'Ext.data.Model', |
3 fields: [ | 3 fields: [ |
4 {name: "id", type: "string", convert: buildId}, | |
4 {name: "probeId"}, | 5 {name: "probeId"}, |
5 {name: "baId"}, | 6 {name: "baId"}, |
6 {name: "datenbasisId"}, | 7 {name: "datenbasisId"}, |
7 {name: "erzeugerId"}, | 8 {name: "erzeugerId"}, |
8 {name: "hauptprobenNr"}, | 9 {name: "hauptprobenNr"}, |
26 {name: "solldatumBeginn", type: 'date', convert: ts2date, defaultValue: new Date()}, | 27 {name: "solldatumBeginn", type: 'date', convert: ts2date, defaultValue: new Date()}, |
27 {name: "solldatumEnde", type: 'date', convert: ts2date, defaultValue: new Date()}, | 28 {name: "solldatumEnde", type: 'date', convert: ts2date, defaultValue: new Date()}, |
28 {name: "test"}, | 29 {name: "test"}, |
29 {name: "umwId"} | 30 {name: "umwId"} |
30 ], | 31 ], |
31 idProperty: "probeId", | 32 idProperty: "id", |
32 proxy: { | 33 proxy: { |
33 type: 'rest', | 34 type: 'rest', |
34 appendId: true, //default | 35 appendId: true, //default |
35 url: 'server/rest/proben', | 36 url: 'server/rest/proben', |
36 api: { | |
37 }, | |
38 reader: { | 37 reader: { |
39 type: 'json', | 38 type: 'json', |
40 root: 'data' | 39 root: 'data' |
41 } | 40 } |
42 } | 41 } |
43 }); | 42 }); |
44 | 43 |
44 function buildId(v, record){ | |
45 var newId = record.get('probeId') + record.get('nebenprobenNr'); | |
46 return newId; | |
47 } | |
48 | |
45 function ts2date(v, record){ | 49 function ts2date(v, record){ |
46 // Converts a timestamp into a date object. | 50 // Converts a timestamp into a date object. |
47 return new Date(v); | 51 return new Date(v); |
48 } | 52 } |