# HG changeset patch # User Torsten Irländer # Date 1372862072 -7200 # Node ID cfa0cc437781671f32517651858e08d1a78d1b94 # Parent c5422819d7b99610f583dd2ff9f49c2db045e483 Implemented opening a new Messungen form when clicking and the "Add Button" on the Messungen listing. diff -r c5422819d7b9 -r cfa0cc437781 app/controller/Messungen.js --- a/app/controller/Messungen.js Wed Jul 03 16:13:36 2013 +0200 +++ b/app/controller/Messungen.js Wed Jul 03 16:34:32 2013 +0200 @@ -1,5 +1,8 @@ Ext.define('Lada.controller.Messungen', { extend: 'Ext.app.Controller', + views: [ + 'messungen.Create' + ], stores: [ 'Messungen', 'Messwerte', @@ -31,8 +34,10 @@ }); }, addZusatzwert: function(button) { - console.log('Adding new Zusatzwert'); - var view = Ext.widget('messungencreate'); + console.log('Adding new Messung for Probe ' + button.probeId); + var messung = Ext.create('Lada.model.Messung'); + messung.set('probeId', button.probeId); + var view = Ext.widget('messungencreate', {model: messung}); }, editZusatzwert: function(grid, record) { console.log('Editing Zusatzwert'); diff -r c5422819d7b9 -r cfa0cc437781 app/controller/Zusatzwerte.js --- a/app/controller/Zusatzwerte.js Wed Jul 03 16:13:36 2013 +0200 +++ b/app/controller/Zusatzwerte.js Wed Jul 03 16:34:32 2013 +0200 @@ -41,7 +41,7 @@ form.commit(); }, addZusatzwert: function(button) { - console.log('Adding new Zusatzwert for Probe' + button.probenId); + console.log('Adding new Zusatzwert for Probe' + button.probeId); var zusatzwert = Ext.create('Lada.model.Zusatzwert'); zusatzwert.set('probeId', button.probeId); var view = Ext.widget('zusatzwertecreate', {model: zusatzwert}); diff -r c5422819d7b9 -r cfa0cc437781 app/view/messungen/Create.js --- a/app/view/messungen/Create.js Wed Jul 03 16:13:36 2013 +0200 +++ b/app/view/messungen/Create.js Wed Jul 03 16:34:32 2013 +0200 @@ -15,12 +15,11 @@ 'Lada.view.messungen.CreateForm' ], initComponent: function() { - var form = Ext.create('Lada.view.messungen.CreateForm'); + var form = Ext.create('Lada.view.messungen.CreateForm', this.initialConfig); this.items = [form]; this.buttons = [ { text: 'Speichern', - handler: form.commit, scope: form } ]; diff -r c5422819d7b9 -r cfa0cc437781 app/view/messungen/List.js --- a/app/view/messungen/List.js Wed Jul 03 16:13:36 2013 +0200 +++ b/app/view/messungen/List.js Wed Jul 03 16:34:32 2013 +0200 @@ -10,6 +10,7 @@ minHeight: 35, deferEmptyText: false }, + probeId: null, initComponent: function() { this.dockedItems = [ { @@ -19,7 +20,8 @@ { text: 'Hinzufügen', icon: 'gfx/plus.gif', - action: 'add' + action: 'add', + probeId: this.probeId }, { text: 'Löschen', diff -r c5422819d7b9 -r cfa0cc437781 app/view/proben/EditForm.js --- a/app/view/proben/EditForm.js Wed Jul 03 16:13:36 2013 +0200 +++ b/app/view/proben/EditForm.js Wed Jul 03 16:34:32 2013 +0200 @@ -200,7 +200,8 @@ padding: '10 10', items: [ { - xtype: 'messungenlist' + xtype: 'messungenlist', + probeId: this.modelId } ] }