diff app/model/Status.js @ 170:738d657d8b6b

Added Status into Messungen listing.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 03 Jul 2013 16:08:22 +0200
parents
children 945a727209d3
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/model/Status.js	Wed Jul 03 16:08:22 2013 +0200
@@ -0,0 +1,33 @@
+Ext.define('Lada.model.Status', {
+    extend: 'Ext.data.Model',
+    fields: [
+        {name: "sId"},
+        {name: "messungsId"},
+        {name: "probeId"},
+        {name: "erzeuger"},
+        {name: "status"},
+        {name: "sdatum", type: 'date', convert: ts2date, defaultValue: new Date()},
+        {name: "stext"}
+    ],
+    idProperty: "sId",
+    proxy: {
+        type: 'rest',
+        appendId: true, //default
+        url: 'server/rest/status',
+        reader: {
+            type: 'json',
+            root: 'data'
+        }
+    },
+    getEidi: function() {
+        var sid =  this.get('sId');
+        var messId = this.get('messungsId');
+        var probeId = this.get('probeId');
+        return "/" + sid + "/" + messId + "/" + probeId;
+    }
+});
+
+function ts2date(v, record){
+    // Converts a timestamp into a date object.
+    return new Date(v);
+}

http://lada.wald.intevation.org