# HG changeset patch # User Torsten Irländer # Date 1386841158 -3600 # Node ID d49a6fcd9f57bdfc8d9e48433bb2b87ffc6d615b # Parent e228fecd15772f738d2ba61cd40ca3e7d14bb942 Fix Creating, editing and deleting of Zusatzwerte. diff -r e228fecd1577 -r d49a6fcd9f57 app/controller/Zusatzwerte.js --- a/app/controller/Zusatzwerte.js Thu Dec 05 17:18:45 2013 +0100 +++ b/app/controller/Zusatzwerte.js Thu Dec 12 10:39:18 2013 +0100 @@ -15,20 +15,20 @@ addListeners: function() { this.control({ 'zusatzwertelist': { - itemdblclick: this.editZusatzwert + itemdblclick: this.editItem }, 'zusatzwertelist toolbar button[action=add]': { - click: this.addZusatzwert + click: this.addItem }, 'zusatzwertelist toolbar button[action=delete]': { - click: this.deleteZusatzwert + click: this.deleteItem }, 'zusatzwertecreate form': { savesuccess: this.createSuccess, savefailure: this.createFailure }, 'zusatzwertecreate button[action=save]': { - click: this.saveZusatzwert + click: this.saveItem }, 'zusatzwerteedit form': { savesuccess: this.editSuccess, @@ -36,13 +36,18 @@ } }); }, - addZusatzwert: function(button) { + saveItem: function(button) { + console.log('Saving new Zusatzwert for Probe ' + button.probeId); + var form = button.up('window').down('form'); + form.commit(); + }, + addItem: function(button) { 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}); }, - editZusatzwert: function(grid, record) { + editItem: function(grid, record) { console.log('Editing Zusatzwert'); record.getAuthInfo(this.initEditWindow) console.log("Loaded Zusatzwert with ID " + record.getId()); //outputs ID