Mercurial > lada > lada-client
annotate app/model/MKommentar.js @ 164:767300b2c70f
Added custom renderer for "Anzahl Kommentare" column count the number of
comments for this messung.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Wed, 03 Jul 2013 14:03:51 +0200 |
parents | 0b635b836903 |
children | f1f0351b6e2f |
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: [ |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
4 {name: "kId"}, |
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 ], |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
11 idProperty: "kId", |
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() { |
0b635b836903
Added model and store for Messungskommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
22 var kid = this.get('kId'); |
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 } |