torsten@103: Ext.define('Lada.model.Messung', { torsten@103: extend: 'Ext.data.Model', torsten@299: requires: ['Lada.lib.Helpers'], torsten@103: fields: [ torsten@162: {name: "id"}, torsten@159: {name: "messungsId", mapping:"id.messungsId"}, torsten@159: {name: "probeId", mapping:"id.probeId"}, torsten@103: {name: "mmtId"}, torsten@103: {name: "nebenprobenNr"}, torsten@103: {name: "messdauer"}, torsten@299: {name: "messzeitpunkt", convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, torsten@103: {name: "fertig", type: "boolean"}, torsten@103: {name: "letzteAenderung", type:"date"}, torsten@103: {name: "geplant", type: "boolean"} torsten@103: ], torsten@212: idProperty: "id", torsten@103: proxy: { torsten@103: type: 'rest', torsten@103: appendId: true, //default torsten@103: url: 'server/rest/messung', torsten@103: reader: { torsten@103: type: 'json', torsten@103: root: 'data' torsten@103: } torsten@212: }, torsten@212: getEidi: function() { torsten@212: var messId = this.get('messungsId'); torsten@212: var probeId = this.get('probeId'); torsten@212: return "/" + messId + "/" + probeId; torsten@103: } torsten@103: }); torsten@171: torsten@171: function ts2date(v, record){ torsten@171: // Converts a timestamp into a date object. torsten@171: return new Date(v); torsten@171: }