Mercurial > lada > lada-client
annotate app/model/MKommentar.js @ 310:aeeb0f534411
Added Base model class
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Fri, 09 Aug 2013 15:37:48 +0200 |
parents | 7b30c20ad1aa |
children | 7de16725d251 |
rev | line source |
---|---|
161
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
1 Ext.define('Lada.model.MKommentar', { |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
2 extend: 'Ext.data.Model', |
301
7b30c20ad1aa
Use ts2date function from lib.Helpers. Remove old code
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
227
diff
changeset
|
3 requires: ['Lada.lib.Helpers'], |
161
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
4 fields: [ |
179
f1f0351b6e2f
Show List of Messungskommentare
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
161
diff
changeset
|
5 {name: "id"}, |
227
d3f4a39bf89e
Set IdProperty and fix creating and updating mkommentar
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
203
diff
changeset
|
6 {name: "kid"}, |
161
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
7 {name: "messungsId"}, |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
8 {name: "probeId"}, |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
9 {name: "erzeuger"}, |
301
7b30c20ad1aa
Use ts2date function from lib.Helpers. Remove old code
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
227
diff
changeset
|
10 {name: "kdatum", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, |
161
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
11 {name: "ktext"} |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
12 ], |
179
f1f0351b6e2f
Show List of Messungskommentare
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
161
diff
changeset
|
13 idProperty: "id", |
161
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
14 proxy: { |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
15 type: 'rest', |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
16 appendId: true, //default |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
17 url: 'server/rest/messkommentare', |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
18 reader: { |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
19 type: 'json', |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
20 root: 'data' |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
21 } |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
22 }, |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
23 getEidi: function() { |
227
d3f4a39bf89e
Set IdProperty and fix creating and updating mkommentar
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
203
diff
changeset
|
24 var kid = this.get('kid'); |
161
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
25 var messId = this.get('messungsId'); |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
26 var probeId = this.get('probeId'); |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
27 return "/" + kid + "/" + messId + "/" + probeId; |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
28 } |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
29 }); |