changeset 104:e9643b7c103c

[mq]: craftid
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 18 Jun 2013 12:40:11 +0200 (2013-06-18)
parents 3552b0ee4526
children 7ad96e3d70c1
files app/model/Probe.js
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/app/model/Probe.js	Mon Jun 17 16:59:04 2013 +0200
+++ b/app/model/Probe.js	Tue Jun 18 12:40:11 2013 +0200
@@ -1,6 +1,7 @@
 Ext.define('Lada.model.Probe', {
     extend: 'Ext.data.Model',
     fields: [
+        {name: "id", type: "string", convert: buildId},
         {name: "probeId"},
         {name: "baId"},
         {name: "datenbasisId"},
@@ -28,13 +29,11 @@
         {name: "test"},
         {name: "umwId"}
     ],
-    idProperty: "probeId",
+    idProperty: "id",
     proxy: {
         type: 'rest',
         appendId: true, //default
         url: 'server/rest/proben',
-        api: {
-        },
         reader: {
             type: 'json',
             root: 'data'
@@ -42,6 +41,11 @@
     }
 });
 
+function buildId(v, record){
+    var newId = record.get('probeId') + record.get('nebenprobenNr');
+    return newId;
+}
+
 function ts2date(v, record){
     // Converts a timestamp into a date object.
     return new Date(v);

http://lada.wald.intevation.org