Mercurial > lada > lada-client
annotate app/model/Status.js @ 325:4c4f03c87d49
Inherit from model.Base
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Tue, 13 Aug 2013 08:47:01 +0200 |
parents | 49a42c7f1d1f |
children | 34ac1c9db042 |
rev | line source |
---|---|
322
49a42c7f1d1f
Added docstring
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
308
diff
changeset
|
1 /** |
49a42c7f1d1f
Added docstring
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
308
diff
changeset
|
2 * Model class for Status |
49a42c7f1d1f
Added docstring
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
308
diff
changeset
|
3 */ |
170
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
4 Ext.define('Lada.model.Status', { |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
5 extend: 'Ext.data.Model', |
308
59c1d9ad6555
Use ts2date function from lib.Helpers. Remove old code
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
225
diff
changeset
|
6 requires: ['Lada.lib.Helpers'], |
170
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
7 fields: [ |
220
8e41a5a6cb7f
Fixed variable name
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
200
diff
changeset
|
8 {name: "sid"}, |
170
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
9 {name: "messungsId"}, |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
10 {name: "probeId"}, |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
11 {name: "erzeuger"}, |
200
945a727209d3
Fixed attribute names in the Status model
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
170
diff
changeset
|
12 {name: "status", defaultValue: 1}, |
308
59c1d9ad6555
Use ts2date function from lib.Helpers. Remove old code
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
225
diff
changeset
|
13 {name: "sdatum", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, |
200
945a727209d3
Fixed attribute names in the Status model
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
170
diff
changeset
|
14 {name: "skommentar"} |
170
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
15 ], |
225
d27017394c8f
Fix ID-property
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
220
diff
changeset
|
16 idProperty: "sid", |
170
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
17 proxy: { |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
18 type: 'rest', |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
19 appendId: true, //default |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
20 url: 'server/rest/status', |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
21 reader: { |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
22 type: 'json', |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
23 root: 'data' |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
24 } |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
25 }, |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
26 getEidi: function() { |
220
8e41a5a6cb7f
Fixed variable name
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
200
diff
changeset
|
27 var sid = this.get('sid'); |
170
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
28 var messId = this.get('messungsId'); |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
29 var probeId = this.get('probeId'); |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
30 return "/" + sid + "/" + messId + "/" + probeId; |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
31 } |
738d657d8b6b
Added Status into Messungen listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
32 }); |