Mercurial > lada > lada-client
comparison app/controller/Messungen.js @ 218:1b5a0cb4fa6c
Fixed delete call
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Mon, 15 Jul 2013 17:10:31 +0200 |
parents | 01021f00ce6a |
children | 5e056c5edf9a |
comparison
equal
deleted
inserted
replaced
217:4db982514a5f | 218:1b5a0cb4fa6c |
---|---|
80 var grid = button.up('grid'); | 80 var grid = button.up('grid'); |
81 var selection = grid.getView().getSelectionModel().getSelection()[0]; | 81 var selection = grid.getView().getSelectionModel().getSelection()[0]; |
82 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){ | 82 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){ |
83 if(btn === 'yes'){ | 83 if(btn === 'yes'){ |
84 var store = grid.getStore(); | 84 var store = grid.getStore(); |
85 store.remove(selection); | 85 var deleteUrl = selection.getProxy().url + selection.getEidi(); |
86 store.sync(); | 86 Ext.Ajax.request({ |
87 console.log('Deleting Kommentar'); | 87 url: deleteUrl, |
88 method: 'DELETE', | |
89 success: function(response, opts) { | |
90 store.reload(); | |
91 } | |
92 }); | |
93 console.log('Deleting Messung'); | |
88 } else { | 94 } else { |
89 console.log('Cancel Deleting Kommentar'); | 95 console.log('Cancel Deleting Messung'); |
90 } | 96 } |
91 }); | 97 }); |
92 }, | 98 }, |
93 createSuccess: function(form, record, operation) { | 99 createSuccess: function(form, record, operation) { |
94 // Reload store | 100 // Reload store |