torsten@472: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz torsten@472: * Software engineering by Intevation GmbH torsten@472: * torsten@472: * This file is Free Software under the GNU GPL (v>=3) torsten@472: * and comes with ABSOLUTELY NO WARRANTY! Check out torsten@472: * the documentation coming with IMIS-Labordaten-Application for details. torsten@472: */ torsten@472: torsten@323: /** torsten@323: * Model class for Zusatzwerte torsten@323: */ torsten@106: Ext.define('Lada.model.Zusatzwert', { torsten@336: extend: 'Lada.model.Base', torsten@106: fields: [ raimund@488: {name: "id"}, raimund@488: {name: "probeId"}, torsten@138: {name: "pzsId"}, torsten@114: {name: "nwgZuMesswert", type: 'float'}, torsten@114: {name: "messwertPzs", type: 'float'}, torsten@114: {name: "messfehler", type: 'float'}, torsten@309: {name: "letzteAenderung", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()} torsten@122: ], raimund@488: idProperty: "id", torsten@106: proxy: { torsten@106: type: 'rest', torsten@106: url: 'server/rest/zusatzwert', torsten@106: reader: { torsten@106: type: 'json', torsten@106: root: 'data' torsten@122: }, torsten@122: writer: { torsten@122: type: 'json', torsten@411: // TODO: Check if this function is really needed (torsten) torsten@411: // <2013-09-18 15:58> torsten@122: writeEverything : true torsten@106: } torsten@131: }, torsten@142: getMesseinheit: function(pzsId) { raimund@488: var zstore = Ext.getStore('StaProbenzusaetze'); raimund@488: var mstore = Ext.getStore('StaMesseinheiten'); torsten@142: var mehId = zstore.getById(pzsId).get('mehId'); raimund@488: console.log('mehid: ' + mehId); raimund@488: var record = mstore.getById(mehId); torsten@142: return record.get('einheit'); torsten@106: } torsten@106: });