Mercurial > lada > lada-client
changeset 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 (2013-06-25) |
parents | 9b14742a8117 |
children | 747d488b9203 |
files | app/controller/Zusatzwerte.js |
diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
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');