diff app/controller/Orte.js @ 217:4db982514a5f

Fixed issue21
author Torsten Irländer <torsten.irlaender@intevation.de>
date Mon, 15 Jul 2013 16:30:52 +0200
parents 6aedf2026fb4
children 73a2c114db64
line wrap: on
line diff
--- a/app/controller/Orte.js	Mon Jul 15 15:30:52 2013 +0200
+++ b/app/controller/Orte.js	Mon Jul 15 16:30:52 2013 +0200
@@ -102,11 +102,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 Ort');
             } else {
-                console.log('Cancel Deleting Kommentar');
+                console.log('Cancel Deleting Ort');
             }
         });
     },

http://lada.wald.intevation.org