diff app/controller/Zusatzwerte.js @ 129:33aed7dde69f

Do not call remove with selection on the store to delete object. Trigger manual delete request as we need to build a custom id.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 25 Jun 2013 14:21:40 +0200
parents 3d8cbc2d0dc1
children 04439f3feba3
line wrap: on
line diff
--- a/app/controller/Zusatzwerte.js	Tue Jun 25 11:49:33 2013 +0200
+++ b/app/controller/Zusatzwerte.js	Tue Jun 25 14:21:40 2013 +0200
@@ -63,8 +63,17 @@
         Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){
             if(btn === 'yes'){
                 var store = grid.getStore();
-                store.remove(selection);
-                store.sync();
+                var sprobenZusatz = selection.get('sprobenZusatz');
+                var pzsId =  sprobenZusatz.pzsId;
+                var probeId = selection.get('probeId');
+                var deleteUrl = selection.getProxy().url + "/" + pzsId + "/" + probeId;
+                Ext.Ajax.request({
+                    url: deleteUrl,
+                    method: 'DELETE',
+                    success: function(response, opts) {
+                        store.reload();
+                    }
+                });
                 console.log('Deleting Kommentar');
             } else {
                 console.log('Cancel Deleting Kommentar');

http://lada.wald.intevation.org