Mercurial > lada > lada-client
view app/model/Probe.js @ 118:f2579cadaee8 tag-refactor
Formatting
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Fri, 21 Jun 2013 10:15:09 +0200 |
parents | fe4a1ee15418 |
children | 1907f405eb93 |
line wrap: on
line source
Ext.define('Lada.model.Probe', { extend: 'Ext.data.Model', fields: [ {name: "id", type: "string", convert: buildId}, {name: "probeId"}, {name: "baId"}, {name: "datenbasisId"}, {name: "erzeugerId"}, {name: "hauptprobenNr"}, {name: "messmethode"}, {name: "nebenprobenNr"}, {name: "bezeichnung"}, {name: "kreis"}, {name: "letzteAenderung", type: 'date', convert: ts2date, defaultValue: new Date()}, {name: "media"}, {name: "mediaDesk"}, {name: "mittelungsdauer"}, {name: "mpKat"}, {name: "mplId"}, {name: "mprId"}, {name: "mstId"}, {name: "netzbetreiberId"}, {name: "probeNehmerId"}, {name: "probeentnahmeBeginn", type: 'date', convert: ts2date, defaultValue: new Date()}, {name: "probeentnahmeEnde", type: 'date', convert: ts2date, defaultValue: new Date()}, {name: "probenartId"}, {name: "solldatumBeginn", type: 'date', convert: ts2date, defaultValue: new Date()}, {name: "solldatumEnde", type: 'date', convert: ts2date, defaultValue: new Date()}, {name: "test"}, {name: "umwId"} ], idProperty: "id", proxy: { type: 'rest', appendId: true, //default url: 'server/rest/proben', reader: { type: 'json', root: 'data' } } }); 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); }