Mercurial > lada > lada-client
annotate app/model/Messung.js @ 171:c5422819d7b9
Show messzeitpunkt in messung listing. Convert timestamp to date.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Wed, 03 Jul 2013 16:13:36 +0200 |
parents | 5eb0cfac0e30 |
children | 92facbaece42 |
rev | line source |
---|---|
103
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
1 Ext.define('Lada.model.Messung', { |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
2 extend: 'Ext.data.Model', |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
3 fields: [ |
162
5eb0cfac0e30
Added nested id attribute which comes in JSON response to the model as we need
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
159
diff
changeset
|
4 {name: "id"}, |
159
f653bd7893c0
Fixed model. Added mapping.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
158
diff
changeset
|
5 {name: "messungsId", mapping:"id.messungsId"}, |
f653bd7893c0
Fixed model. Added mapping.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
158
diff
changeset
|
6 {name: "probeId", mapping:"id.probeId"}, |
103
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
7 {name: "mmtId"}, |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
8 {name: "nebenprobenNr"}, |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
9 {name: "messdauer"}, |
171
c5422819d7b9
Show messzeitpunkt in messung listing. Convert timestamp to date.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
162
diff
changeset
|
10 {name: "messzeitpunkt", convert: ts2date}, |
103
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
11 {name: "fertig", type: "boolean"}, |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
12 {name: "letzteAenderung", type:"date"}, |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
13 {name: "geplant", type: "boolean"} |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
14 ], |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
15 idProperty: "convertedId", |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
16 proxy: { |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
17 type: 'rest', |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
18 appendId: true, //default |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
19 url: 'server/rest/messung', |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
20 reader: { |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
21 type: 'json', |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
22 root: 'data' |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
23 } |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
24 } |
3552b0ee4526
Added Messungenlist to the Proben eddit view.
Torsten Irländer <torsten@irlaender.de>
parents:
diff
changeset
|
25 }); |
171
c5422819d7b9
Show messzeitpunkt in messung listing. Convert timestamp to date.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
162
diff
changeset
|
26 |
c5422819d7b9
Show messzeitpunkt in messung listing. Convert timestamp to date.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
162
diff
changeset
|
27 function ts2date(v, record){ |
c5422819d7b9
Show messzeitpunkt in messung listing. Convert timestamp to date.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
162
diff
changeset
|
28 // Converts a timestamp into a date object. |
c5422819d7b9
Show messzeitpunkt in messung listing. Convert timestamp to date.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
162
diff
changeset
|
29 return new Date(v); |
c5422819d7b9
Show messzeitpunkt in messung listing. Convert timestamp to date.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
162
diff
changeset
|
30 } |