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', raimund@491: raimund@491: fields: [{ raimund@491: name: "id" raimund@491: }, { raimund@491: name: "probeId" raimund@491: }, { raimund@491: name: "pzsId" raimund@491: }, { raimund@491: name: "nwgZuMesswert", raimund@491: type: 'float' raimund@491: }, { raimund@491: name: "messwertPzs", raimund@491: type: 'float' raimund@491: }, { raimund@491: name: "messfehler", raimund@491: type: 'float' raimund@491: }, { raimund@491: name: "letzteAenderung", raimund@491: type: 'date', raimund@491: convert: Lada.lib.Helpers.ts2date, raimund@491: defaultValue: new Date() raimund@491: }], raimund@491: raimund@488: idProperty: "id", raimund@491: 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: }, raimund@491: 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: });