annotate app/model/Kommentar.js @ 106:b91d5376db19

Load Zusatzwerte from server
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 18 Jun 2013 14:02:48 +0200
parents 8356595f4fdb
children 84f32c62670f
rev   line source
53
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
1 Ext.define('Lada.model.Kommentar', {
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
2 extend: 'Ext.data.Model',
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
3 fields: [
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
4 {name: "id"},
100
8356595f4fdb Changed store. Elements are in thate data attribute. Build custom id
Torsten Irländer <torsten@irlaender.de>
parents: 62
diff changeset
5 {name: "kid", mapping:"id.kid"},
8356595f4fdb Changed store. Elements are in thate data attribute. Build custom id
Torsten Irländer <torsten@irlaender.de>
parents: 62
diff changeset
6 {name: "convertedId", convert:buildId},
53
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
7 {name: "probeId"},
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
8 {name: "erzeuger"},
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
9 {name: "kdatum"},
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
10 {name: "ktext"}
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
11 ],
100
8356595f4fdb Changed store. Elements are in thate data attribute. Build custom id
Torsten Irländer <torsten@irlaender.de>
parents: 62
diff changeset
12 idProperty: "convertedId",
53
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
13 proxy: {
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
14 type: 'rest',
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
15 appendId: true, //default
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
16 url: 'server/rest/kommentare',
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
17 reader: {
100
8356595f4fdb Changed store. Elements are in thate data attribute. Build custom id
Torsten Irländer <torsten@irlaender.de>
parents: 62
diff changeset
18 type: 'json',
8356595f4fdb Changed store. Elements are in thate data attribute. Build custom id
Torsten Irländer <torsten@irlaender.de>
parents: 62
diff changeset
19 root: 'data'
53
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
20 }
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
21 }
73bc17de6ff2 Added store, view and model for kommentare. Load kommentare when opening a probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
22 });
100
8356595f4fdb Changed store. Elements are in thate data attribute. Build custom id
Torsten Irländer <torsten@irlaender.de>
parents: 62
diff changeset
23
8356595f4fdb Changed store. Elements are in thate data attribute. Build custom id
Torsten Irländer <torsten@irlaender.de>
parents: 62
diff changeset
24 function buildId(v, record){
8356595f4fdb Changed store. Elements are in thate data attribute. Build custom id
Torsten Irländer <torsten@irlaender.de>
parents: 62
diff changeset
25 return record.get('probeId') + record.get('kid');
8356595f4fdb Changed store. Elements are in thate data attribute. Build custom id
Torsten Irländer <torsten@irlaender.de>
parents: 62
diff changeset
26 }

http://lada.wald.intevation.org