changeset 218:1b5a0cb4fa6c

Fixed delete call
author Torsten Irländer <torsten.irlaender@intevation.de>
date Mon, 15 Jul 2013 17:10:31 +0200
parents 4db982514a5f
children 82f8b5638f26
files app/controller/Messungen.js
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Messungen.js	Mon Jul 15 16:30:52 2013 +0200
+++ b/app/controller/Messungen.js	Mon Jul 15 17:10:31 2013 +0200
@@ -82,11 +82,17 @@
         Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){
             if(btn === 'yes'){
                 var store = grid.getStore();
-                store.remove(selection);
-                store.sync();
-                console.log('Deleting Kommentar');
+                var deleteUrl = selection.getProxy().url + selection.getEidi();
+                Ext.Ajax.request({
+                    url: deleteUrl,
+                    method: 'DELETE',
+                    success: function(response, opts) {
+                        store.reload();
+                    }
+                });
+                console.log('Deleting Messung');
             } else {
-                console.log('Cancel Deleting Kommentar');
+                console.log('Cancel Deleting Messung');
             }
         });
     },

http://lada.wald.intevation.org