torsten@170: Ext.define('Lada.model.Status', { torsten@170: extend: 'Ext.data.Model', torsten@170: fields: [ torsten@170: {name: "sId"}, torsten@170: {name: "messungsId"}, torsten@170: {name: "probeId"}, torsten@170: {name: "erzeuger"}, torsten@200: {name: "status", defaultValue: 1}, torsten@170: {name: "sdatum", type: 'date', convert: ts2date, defaultValue: new Date()}, torsten@200: {name: "skommentar"} torsten@170: ], torsten@170: idProperty: "sId", torsten@170: proxy: { torsten@170: type: 'rest', torsten@170: appendId: true, //default torsten@170: url: 'server/rest/status', torsten@170: reader: { torsten@170: type: 'json', torsten@170: root: 'data' torsten@170: } torsten@170: }, torsten@170: getEidi: function() { torsten@170: var sid = this.get('sId'); torsten@170: var messId = this.get('messungsId'); torsten@170: var probeId = this.get('probeId'); torsten@170: return "/" + sid + "/" + messId + "/" + probeId; torsten@170: } torsten@170: }); torsten@170: torsten@170: function ts2date(v, record){ torsten@170: // Converts a timestamp into a date object. torsten@170: return new Date(v); torsten@170: }