torsten@161: Ext.define('Lada.model.MKommentar', { torsten@161: extend: 'Ext.data.Model', torsten@161: fields: [ torsten@179: {name: "id"}, torsten@227: {name: "kid"}, torsten@161: {name: "messungsId"}, torsten@161: {name: "probeId"}, torsten@161: {name: "erzeuger"}, torsten@161: {name: "kdatum", type: 'date', convert: ts2date, defaultValue: new Date()}, torsten@161: {name: "ktext"} torsten@161: ], torsten@179: idProperty: "id", torsten@161: proxy: { torsten@161: type: 'rest', torsten@161: appendId: true, //default torsten@161: url: 'server/rest/messkommentare', torsten@161: reader: { torsten@161: type: 'json', torsten@161: root: 'data' torsten@161: } torsten@161: }, torsten@161: getEidi: function() { torsten@227: var kid = this.get('kid'); torsten@161: var messId = this.get('messungsId'); torsten@161: var probeId = this.get('probeId'); torsten@161: return "/" + kid + "/" + messId + "/" + probeId; torsten@161: } torsten@161: }); torsten@161: torsten@161: function ts2date(v, record){ torsten@161: // Converts a timestamp into a date object. torsten@161: return new Date(v); torsten@161: }