# HG changeset patch # User Torsten Irländer # Date 1370439822 -7200 # Node ID 1a943947a7d2bfbdd2321d70e632454f3740cabf # Parent cb1138f5cea739c912c16a40aad64cb3ee3a9103 Added new listeners for events comming from the Probenforms. diff -r cb1138f5cea7 -r 1a943947a7d2 app/controller/Proben.js --- a/app/controller/Proben.js Wed Jun 05 15:43:05 2013 +0200 +++ b/app/controller/Proben.js Wed Jun 05 15:43:42 2013 +0200 @@ -27,11 +27,18 @@ 'probenlist toolbar button[action=add]': { click: this.addProbe }, + 'probencreate form': { + savesuccess: this.createSuccess, + savefailure: this.createFailure + }, + 'probenedit form': { + savesuccess: this.editSuccess, + savefailure: this.editFailure } }); }, addProbe: function(button) { - console.log('Adding new Probe'); + console.log('Adding new Probe 1'); var view = Ext.widget('probencreate'); }, editProbe: function(grid, record) { @@ -56,5 +63,25 @@ createSuccess: function(form, record, operation) { var win = form.up('window'); win.close(); + }, + createFailure: function(form, record, operation) { + Ext.MessageBox.show({ + title: 'Fehler beim Speichern', + msg: 'Es gab Fehler beim Anlegen der Probe', + icon: Ext.MessageBox.ERROR, + buttons: Ext.Msg.OK + }); + }, + editSuccess: function(form, record, operation) { + var win = form.up('window'); + win.close(); + }, + editFailure: function(form, record, operation) { + Ext.MessageBox.show({ + title: 'Fehler beim Speichern', + msg: 'Es gab Fehler beim Speichern der Probe', + icon: Ext.MessageBox.ERROR, + buttons: Ext.Msg.OK + }); } });