annotate app/model/MKommentar.js @ 192:d38b763806b0

Added action attribute to button. Needed for listener.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Mon, 08 Jul 2013 14:25:02 +0200
parents f1f0351b6e2f
children 8970cbad6cae
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',
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
3 fields: [
179
f1f0351b6e2f Show List of Messungskommentare
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 161
diff changeset
4 {name: "id"},
161
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
5 {name: "messungsId"},
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
6 {name: "probeId"},
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
7 {name: "erzeuger"},
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
8 {name: "kdatum", type: 'date', convert: ts2date, defaultValue: new Date()},
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
9 {name: "ktext"}
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
10 ],
179
f1f0351b6e2f Show List of Messungskommentare
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 161
diff changeset
11 idProperty: "id",
161
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
12 proxy: {
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
13 type: 'rest',
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
14 appendId: true, //default
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
15 url: 'server/rest/messkommentare',
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
16 reader: {
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
17 type: 'json',
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
18 root: 'data'
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
19 }
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
20 },
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
21 getEidi: function() {
179
f1f0351b6e2f Show List of Messungskommentare
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 161
diff changeset
22 var kid = this.get('id.kid');
161
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
23 var messId = this.get('messungsId');
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
24 var probeId = this.get('probeId');
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
25 return "/" + kid + "/" + messId + "/" + probeId;
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
26 }
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
27 });
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 function ts2date(v, record){
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
30 // Converts a timestamp into a date object.
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
31 return new Date(v);
0b635b836903 Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
32 }

http://lada.wald.intevation.org