[Lada-commits] [PATCH 04 of 13] Added model and store for Messungskommentare

Wald Commits scm-commit at wald.intevation.org
Wed Jul 3 16:09:20 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1372852855 -7200
# Node ID 0b635b836903eba47a860b528e98cd9c33cdbad3
# Parent  c932b0b41d2affa8147a0ba5c80d15e2288a0acc
Added model and store for Messungskommentare.

diff -r c932b0b41d2a -r 0b635b836903 app/model/MKommentar.js
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/model/MKommentar.js	Wed Jul 03 14:00:55 2013 +0200
@@ -0,0 +1,32 @@
+Ext.define('Lada.model.MKommentar', {
+    extend: 'Ext.data.Model',
+    fields: [
+        {name: "kId"},
+        {name: "messungsId"},
+        {name: "probeId"},
+        {name: "erzeuger"},
+        {name: "kdatum", type: 'date', convert: ts2date, defaultValue: new Date()},
+        {name: "ktext"}
+    ],
+    idProperty: "kId",
+    proxy: {
+        type: 'rest',
+        appendId: true, //default
+        url: 'server/rest/messkommentare',
+        reader: {
+            type: 'json',
+            root: 'data'
+        }
+    },
+    getEidi: function() {
+        var kid =  this.get('kId');
+        var messId = this.get('messungsId');
+        var probeId = this.get('probeId');
+        return "/" + kid + "/" + messId + "/" + probeId;
+    }
+});
+
+function ts2date(v, record){
+    // Converts a timestamp into a date object.
+    return new Date(v);
+}
diff -r c932b0b41d2a -r 0b635b836903 app/store/MKommentare.js
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/store/MKommentare.js	Wed Jul 03 14:00:55 2013 +0200
@@ -0,0 +1,5 @@
+Ext.define('Lada.store.MKommentare', {
+    extend: 'Ext.data.Store',
+    model: 'Lada.model.MKommentar'
+});
+


More information about the Lada-commits mailing list