annotate app/model/Messwert.js @ 1076:e32c10cf5499

Added model/store, view and controller for messung list.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 08 Apr 2016 19:32:02 +0200
parents 1d20cec263ee
children 9a0f7712f366
rev   line source
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9 /**
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 * Model class for Messwerte
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 */
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.model.Messwert', {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 extend: 'Ext.data.Model',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15 fields: [{
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 name: 'id'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 }, {
691
c5b8896768a2 Added Owner to Model
Dustin Demuth <dustin@intevation.de>
parents: 564
diff changeset
18 name: 'owner',
c5b8896768a2 Added Owner to Model
Dustin Demuth <dustin@intevation.de>
parents: 564
diff changeset
19 type: 'boolean'
c5b8896768a2 Added Owner to Model
Dustin Demuth <dustin@intevation.de>
parents: 564
diff changeset
20 }, {
702
0c8e689f3bcb Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case
Dustin Demuth <dustin@intevation.de>
parents: 698
diff changeset
21 name: 'readonly',
0c8e689f3bcb Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case
Dustin Demuth <dustin@intevation.de>
parents: 698
diff changeset
22 type: 'boolean',
0c8e689f3bcb Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case
Dustin Demuth <dustin@intevation.de>
parents: 698
diff changeset
23 persist: false
0c8e689f3bcb Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case
Dustin Demuth <dustin@intevation.de>
parents: 698
diff changeset
24 }, {
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 name: 'messungsId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 name: 'messgroesseId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 name: 'messwert',
1054
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
30 serialize: function(v) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
31 if (!v || v === '') {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
32 return v;
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
33 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
34 if (v.indexOf(',') > 0) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
35 v = v.replace(',', '.');
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
36 return v;
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
37 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
38 return v;
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
39 },
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
40 convert: function(value) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
41 if (!value || value === '') {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
42 return value;
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
43 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
44 var valueString = value.toString();
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
45 if (valueString.indexOf('E') > 0) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
46 valueString = valueString.replace('E', 'e');
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
47 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
48 var tmp;
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
49 if (valueString.indexOf('e') > 0) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
50 tmp = valueString;
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
51 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
52 else {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
53 // Currently not locale friendly...
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
54 if (valueString.indexOf(',') > 0) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
55 valueString = valueString.replace(',', '.');
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
56 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
57 tmp = parseFloat(valueString).toExponential();
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
58 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
59 var parts = tmp.split('e');
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
60 if (parts[0].indexOf('.') > 0) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
61 var floatPart = parseFloat(parts[0]);
1069
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
62 var separator = floatPart.toFixed(2).toLocaleString().replace(/[-\d]/g, '');
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
63 parts[0] = floatPart.toFixed(2).replace('.', separator);
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
64 }
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
65 else if (parts[0].indexOf(',') < 0) {
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
66 parts[0] = parts[0] + ',00';
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
67 }
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
68 var intPart = parseInt(parts[1]);
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
69 if (intPart < 10 && intPart >= 0) {
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
70 parts[1] = '+0' + parseInt(parts[1]);
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
71 }
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
72 else if (intPart < 0 && intPart > -10) {
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
73 parts[1] = parts[1].replace('-', '-0');
1054
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
74 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
75 return parts[0] + 'e' + parts[1];
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
76 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 }, {
991
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 970
diff changeset
78 name: 'messwertNwg',
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 970
diff changeset
79 convert: function(v) {
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 970
diff changeset
80 if (!v) {
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 970
diff changeset
81 return null;
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 970
diff changeset
82 }
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 970
diff changeset
83 return "<";
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 970
diff changeset
84 },
19b78162e128 reorg mewwert grid
Michael Stanko <mstanko@bfs.de>
parents: 970
diff changeset
85 // defaultValue: null
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87 name: 'messfehler',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 type: 'float'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 name: 'nwgZuMesswert',
1054
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
91 serialize: function(v) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
92 if (!v || v === '') {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
93 return v;
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
94 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
95 if (v.indexOf(',') > 0) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
96 v = v.replace(',', '.');
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
97 return v;
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
98 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
99 return v;
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
100 },
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
101 convert: function(value) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
102 if (!value || value === '') {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
103 return value;
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
104 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
105 var valueString = value.toString();
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
106 if (valueString.indexOf('E') > 0) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
107 valueString = valueString.replace('E', 'e');
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
108 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
109 var tmp;
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
110 if (valueString.indexOf('e') > 0) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
111 tmp = valueString;
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
112 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
113 else {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
114 // Currently not locale friendly...
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
115 if (valueString.indexOf(',') > 0) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
116 valueString = valueString.replace(',', '.');
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
117 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
118 tmp = parseFloat(valueString).toExponential();
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
119 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
120 var parts = tmp.split('e');
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
121 if (parts[0].indexOf('.') > 0) {
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
122 var floatPart = parseFloat(parts[0]);
1069
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
123 var separator = floatPart.toFixed(2).toLocaleString().replace(/[-\d]/g, '');
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
124 parts[0] = floatPart.toFixed(2).replace('.', separator);
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
125 }
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
126 else if (parts[0].indexOf(',') < 0) {
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
127 parts[0] = parts[0] + ',00';
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
128 }
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
129 var intPart = parseInt(parts[1]);
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
130 if (intPart < 10 && intPart >= 0) {
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
131 parts[1] = '+0' + parseInt(parts[1]);
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
132 }
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
133 else if (intPart < 0 && intPart > -10) {
1d20cec263ee Fixed exponential number format.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1065
diff changeset
134 parts[1] = parts[1].replace('-', '-0');
1054
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
135 }
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
136 return parts[0] + 'e' + parts[1];
7e801af49eeb Use exponential notation for messwerte and zusatzwerte.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1007
diff changeset
137 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
138 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
139 name: 'mehId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
141 name: 'grenzwertueberschreitung',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
142 type: 'boolean'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
143 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
144 name: 'letzteAenderung',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
145 type: 'date',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
146 convert: function(v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
147 if (!v) {
564
7a163f7ad5d8 Datumsumwandlung Timestamp -> Datum korrigiert
Dustin Demuth <dustin@intevation.de>
parents: 562
diff changeset
148 return new Date();
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
149 }
564
7a163f7ad5d8 Datumsumwandlung Timestamp -> Datum korrigiert
Dustin Demuth <dustin@intevation.de>
parents: 562
diff changeset
150 return new Date(v);
970
f4eb53ba63fc Setting Timestamps the correct way. Before this commit the times of the instatiation of the model were used as default values, which led to wrong dates.
Dustin Demuth <dustin@intevation.de>
parents: 711
diff changeset
151 }
689
c07419f07a0c Added field treeModified to models.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 564
diff changeset
152 }, {
711
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
153 name: 'treeModified',
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
154 serialize: function(value) {
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
155 if (value === '') {
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
156 return null;
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
157 }
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
158 return value;
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
159 }
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
160 }, {
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
161 name: 'parentModified',
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
162 serialize: function(value) {
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
163 if (value === '') {
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
164 return null;
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
165 }
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
166 return value;
af16a257d5f6 Updated the model to have correct tree_modified value and parent_modified
Raimund Renkert <raimund.renkert@intevation.de>
parents: 702
diff changeset
167 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
168 }],
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
169
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
170 idProperty: 'id',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
171
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
172 proxy: {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
173 type: 'rest',
999
f73ca04d73a7 Refactored Server URL
Dustin Demuth <dustin@intevation.de>
parents: 970
diff changeset
174 url: 'lada-server/rest/messwert',
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
175 reader: {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
176 type: 'json',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
177 root: 'data'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
178 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
179 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
180 });

http://lada.wald.intevation.org