Mercurial > lada > lada-client
diff app/model/Kommentar.js @ 144:7b1140bd8b3d
Re-Added Kommentare
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Mon, 01 Jul 2013 10:15:00 +0200 |
parents | 84f32c62670f |
children | 53a446d4f424 |
line wrap: on
line diff
--- a/app/model/Kommentar.js Fri Jun 28 11:16:44 2013 +0200 +++ b/app/model/Kommentar.js Mon Jul 01 10:15:00 2013 +0200 @@ -1,15 +1,13 @@ Ext.define('Lada.model.Kommentar', { extend: 'Ext.data.Model', fields: [ - {name: "id"}, - {name: "kid", mapping:"id.kid"}, - {name: "convertedId", convert:buildId}, + {name: "kId"}, {name: "probeId"}, {name: "erzeuger"}, {name: "kdatum", type: 'date', convert: ts2date, defaultValue: new Date()}, {name: "ktext"} ], - idProperty: "convertedId", + idProperty: "kId", proxy: { type: 'rest', appendId: true, //default @@ -18,13 +16,14 @@ type: 'json', root: 'data' } + }, + getEidi: function() { + var kid = this.get('kId'); + var probeId = this.get('probeId'); + return "/" + kid + "/" + probeId; } }); -function buildId(v, record){ - return record.get('probeId') + record.get('kid'); -} - function ts2date(v, record){ // Converts a timestamp into a date object. return new Date(v);