[Lada-commits] [PATCH 1 of 3] Fixed issue21

Wald Commits scm-commit at wald.intevation.org
Mon Jul 15 17:23:03 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1373898652 -7200
# Node ID 4db982514a5fdc6937840d080502ec153b0a5caf
# Parent  6aedf2026fb46746e682bb146706e37c8697feae
Fixed issue21

diff -r 6aedf2026fb4 -r 4db982514a5f app/controller/Orte.js
--- 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');
             }
         });
     },
diff -r 6aedf2026fb4 -r 4db982514a5f app/model/Ort.js
--- a/app/model/Ort.js	Mon Jul 15 15:30:52 2013 +0200
+++ b/app/model/Ort.js	Mon Jul 15 16:30:52 2013 +0200
@@ -20,6 +20,11 @@
             type: 'json',
             root: 'data'
         }
+    },
+    getEidi: function() {
+        var ortId = this.get('portId');
+        var probeId = this.get('probeId');
+        return "/" + ortId + "/" + probeId;
     }
 });
 


More information about the Lada-commits mailing list