annotate app/model/Ort.js @ 303:eb483558bce4

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 4db982514a5f
children 0a5f6db02965
rev   line source
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
1 Ext.define('Lada.model.Ort', {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
2 extend: 'Ext.data.Model',
303
eb483558bce4 Use ts2date function from lib.Helpers. Remove old code
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 217
diff changeset
3 requires: ['Lada.lib.Helpers'],
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
4 fields: [
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
5 // Field from the l_ort table
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
6 {name: "portId", type: 'int'},
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
7 {name: "ortId", type: 'int'},
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
8 {name: "probeId"},
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
9 {name: "ortsTyp"},
154
16ba7e2465fd Implemented creating and editing new l_ort. Created editing orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 149
diff changeset
10 {name: "ortszusatztext"},
303
eb483558bce4 Use ts2date function from lib.Helpers. Remove old code
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 217
diff changeset
11 {name: "letzteAenderung", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
12 ],
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
13 idProperty: "portId",
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
14 proxy: {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
15 type: 'rest',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
16 appendId: true, //default
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
17 url: 'server/rest/ort',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
18 api: {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
19 },
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
20 reader: {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
21 type: 'json',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
22 root: 'data'
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
23 }
217
4db982514a5f Fixed issue21
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 154
diff changeset
24 },
4db982514a5f Fixed issue21
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 154
diff changeset
25 getEidi: function() {
4db982514a5f Fixed issue21
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 154
diff changeset
26 var ortId = this.get('portId');
4db982514a5f Fixed issue21
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 154
diff changeset
27 var probeId = this.get('probeId');
4db982514a5f Fixed issue21
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 154
diff changeset
28 return "/" + ortId + "/" + probeId;
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
29 }
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
30 });

http://lada.wald.intevation.org