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