Mercurial > lada > lada-client
changeset 106:b91d5376db19
Load Zusatzwerte from server
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Tue, 18 Jun 2013 14:02:48 +0200 (2013-06-18) |
parents | 7ad96e3d70c1 |
children | 84f32c62670f |
files | app/controller/Proben.js app/model/Zusatzwert.js app/store/Zusatzwerte.js app/view/proben/Edit.js app/view/proben/EditForm.js app/view/zusatzwerte/List.js server/rest/zusatzwert |
diffstat | 7 files changed, 94 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- a/app/controller/Proben.js Tue Jun 18 13:21:57 2013 +0200 +++ b/app/controller/Proben.js Tue Jun 18 14:02:48 2013 +0200 @@ -14,7 +14,8 @@ 'Betriebsart', 'Netzbetreiber', 'Testdatensatz', - 'Messungen' + 'Messungen', + 'Zusatzwerte' ], models: [ 'Probe'
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/model/Zusatzwert.js Tue Jun 18 14:02:48 2013 +0200 @@ -0,0 +1,32 @@ +Ext.define('Lada.model.Zusatzwert', { + extend: 'Ext.data.Model', + fields: [ + {name: "id"}, + {name: "convertedId", convert:buildId}, + {name: "probeId"}, + {name: "messwertNwg"}, + {name: "messwertPzs"}, + {name: "messfehler"}, + {name: "mehId"}, + {name: "letzteAenderung"}, + {name: "sprobenZusatz"}, + {name: "pzsId"}, + {name: "beschreibung"}, + {name: "zusatzwert"}, + {name: "eudfKeyword"} + ], + idProperty: "convertedId", + proxy: { + type: 'rest', + appendId: true, //default + url: 'server/rest/zusatzwert', + reader: { + type: 'json', + root: 'data' + } + } +}); + +function buildId(v, record){ + return record.get('probeId') + record.get('pzsId'); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/store/Zusatzwerte.js Tue Jun 18 14:02:48 2013 +0200 @@ -0,0 +1,5 @@ +Ext.define('Lada.store.Zusatzwerte', { + extend: 'Ext.data.Store', + model: 'Lada.model.Zusatzwert' +}); +
--- a/app/view/proben/Edit.js Tue Jun 18 13:21:57 2013 +0200 +++ b/app/view/proben/Edit.js Tue Jun 18 14:02:48 2013 +0200 @@ -21,7 +21,8 @@ 'Lada.view.widgets.Netzbetreiber', 'Lada.view.kommentare.List', 'Lada.view.orte.List', - 'Lada.view.messungen.List' + 'Lada.view.messungen.List', + 'Lada.view.zusatzwerte.List' ], initComponent: function() { @@ -48,6 +49,15 @@ //probe: record.data['probeId'] } }); + // Load Zusatzwerte + var zwerte = form.down('zusatzwertelist'); + var zstore = zwerte.getStore(); + zstore.load({ + params: { + probe: this.initialConfig['modelId'] + //probe: record.data['probeId'] + } + }); // Load Messungen var messungen = form.down('messungenlist'); var mstore = messungen.getStore();
--- a/app/view/proben/EditForm.js Tue Jun 18 13:21:57 2013 +0200 +++ b/app/view/proben/EditForm.js Tue Jun 18 14:02:48 2013 +0200 @@ -160,46 +160,7 @@ collapsed: true, padding: '10 10', items: [ - { - xtype: 'grid', - dockedItems: [ - { - xtype: 'toolbar', - dock: 'top', - items: [ - { - text: 'Hinzufügen', - icon: 'gfx/plus.gif' - }, - { - text: 'Löschen', - icon: 'gfx/minus.gif' - } - ] - } - ], - columns: [ - { - text: 'PZW-ID' - }, - { - text: 'PZW-Größe' - }, - { - text: '< NWG' - }, - { - text: '< PZW' - }, - { - text: 'rel. Unsich.[%]' - }, - { - text: 'Maßeinheit', - flex: 1 - } - ] - } + { xtype: 'zusatzwertelist' } ] }, // Probenkommentar
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/view/zusatzwerte/List.js Tue Jun 18 14:02:48 2013 +0200 @@ -0,0 +1,42 @@ +Ext.define('Lada.view.zusatzwerte.List' ,{ + extend: 'Ext.grid.Panel', + alias: 'widget.zusatzwertelist', + store: 'Zusatzwerte', + viewConfig: { + maxHeight: 350, + emptyText: 'Keine Zusatzwerte gefunden.', + // minHeight and deferEmptyText are needed to be able to show the + // emptyText message. + minHeight: 35, + deferEmptyText: false + }, + initComponent: function() { + this.dockedItems = [ + { + xtype: 'toolbar', + dock: 'top', + items: [ + { + text: 'Hinzufügen', + icon: 'gfx/plus.gif', + action: 'add' + }, + { + text: 'Löschen', + icon: 'gfx/minus.gif', + action: 'delete' + } + ] + } + ]; + this.columns = [ + {header: 'PZW-ID', dataIndex: 'pzsId'}, + {header: 'PWZ-Größe', dataIndex: ''}, + {header: '<NWG', dataIndex: 'messwertNwg'}, + {header: '<PZW', dataIndex: 'messwertPzs'}, + {header: 'rel. Unsich.[%]', dataIndex: 'messfehler'}, + {header: 'Maßeinheit', dataIndex: ''} + ]; + this.callParent(arguments); + } +});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/rest/zusatzwert Tue Jun 18 14:02:48 2013 +0200 @@ -0,0 +1,1 @@ +{"success":true,"message":"200","data":[{"id":{"probeId":"000007578314X","pzsId":"A76"},"probeId":"000007578314X","messwertNwg":null,"messwertPzs":13.0,"messfehler":30.0,"mehId":2,"letzteAenderung":1341898845000,"sprobenZusatz":{"pzsId":"A76","mehId":2,"beschreibung":"A0-Horizont (Humusauflage)","zusatzwert":"A0-HZT","eudfKeyword":null}}],"errors":{},"warnings":{}} \ No newline at end of file