diff 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
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