comparison app/controller/Messungen.js @ 194:5d72d74a2daf

Added function to save a Messung.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Mon, 08 Jul 2013 14:26:05 +0200
parents 93de61af9b9e
children 01021f00ce6a
comparison
equal deleted inserted replaced
193:93de61af9b9e 194:5d72d74a2daf
35 savesuccess: this.editSuccess, 35 savesuccess: this.editSuccess,
36 savefailure: this.editFailure 36 savefailure: this.editFailure
37 } 37 }
38 }); 38 });
39 }, 39 },
40 addZusatzwert: function(button) { 40 saveMessung: function(button) {
41 console.log('Saving new Messung for Probe ' + button.probeId);
42 var form = button.up('window').down('form');
43 form.commit();
44 },
45 addMessung: function(button) {
41 console.log('Adding new Messung for Probe ' + button.probeId); 46 console.log('Adding new Messung for Probe ' + button.probeId);
42 var messung = Ext.create('Lada.model.Messung'); 47 var messung = Ext.create('Lada.model.Messung');
43 messung.set('probeId', button.probeId); 48 messung.set('probeId', button.probeId);
44 var view = Ext.widget('messungencreate', {model: messung}); 49 var view = Ext.widget('messungencreate', {model: messung});
45 }, 50 },
46 editZusatzwert: function(grid, record) { 51 editMessung: function(grid, record) {
47 console.log('Editing Zusatzwert'); 52 console.log('Editing Messung');
48 var view = Ext.widget('messungencreate', {model: record}); 53 var view = Ext.widget('messungencreate', {model: record});
49 console.log("Loaded Zusatzwert with ID " + record.getId()); //outputs ID 54 console.log("Loaded Messung with ID " + record.getId()); //outputs ID
50 }, 55 },
51 deleteZusatzwert: function(button) { 56 deleteMessung: function(button) {
52 // Get selected item in grid 57 // Get selected item in grid
53 var grid = button.up('grid'); 58 var grid = button.up('grid');
54 var selection = grid.getView().getSelectionModel().getSelection()[0]; 59 var selection = grid.getView().getSelectionModel().getSelection()[0];
55 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){ 60 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){
56 if(btn === 'yes'){ 61 if(btn === 'yes'){

http://lada.wald.intevation.org