Mercurial > lada > lada-client
annotate app/model/Status.js @ 206:32e1356cf391
Preload Mkommentar Controller.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Mon, 08 Jul 2013 16:47:50 +0200 |
parents | 945a727209d3 |
children | 8e41a5a6cb7f |
rev | line source |
---|---|
170
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
1 Ext.define('Lada.model.Status', { |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
2 extend: 'Ext.data.Model', |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
3 fields: [ |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
4 {name: "sId"}, |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
5 {name: "messungsId"}, |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
6 {name: "probeId"}, |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
7 {name: "erzeuger"}, |
200
945a727209d3
Fixed attribute names in the Status model
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
170
diff
changeset
|
8 {name: "status", defaultValue: 1}, |
170
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
9 {name: "sdatum", type: 'date', convert: ts2date, defaultValue: new Date()}, |
200
945a727209d3
Fixed attribute names in the Status model
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
170
diff
changeset
|
10 {name: "skommentar"} |
170
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
11 ], |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
12 idProperty: "sId", |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
13 proxy: { |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
14 type: 'rest', |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
15 appendId: true, //default |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
16 url: 'server/rest/status', |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
17 reader: { |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
18 type: 'json', |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
19 root: 'data' |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
20 } |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
21 }, |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
22 getEidi: function() { |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
23 var sid = this.get('sId'); |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
24 var messId = this.get('messungsId'); |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
25 var probeId = this.get('probeId'); |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
26 return "/" + sid + "/" + messId + "/" + probeId; |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
27 } |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
28 }); |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
29 |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
30 function ts2date(v, record){ |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
31 // Converts a timestamp into a date object. |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
32 return new Date(v); |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
33 } |