Mercurial > lada > lada-client
comparison 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 |
comparison
equal
deleted
inserted
replaced
128:9b14742a8117 | 129:33aed7dde69f |
---|---|
61 var grid = button.up('grid'); | 61 var grid = button.up('grid'); |
62 var selection = grid.getView().getSelectionModel().getSelection()[0]; | 62 var selection = grid.getView().getSelectionModel().getSelection()[0]; |
63 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){ | 63 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){ |
64 if(btn === 'yes'){ | 64 if(btn === 'yes'){ |
65 var store = grid.getStore(); | 65 var store = grid.getStore(); |
66 store.remove(selection); | 66 var sprobenZusatz = selection.get('sprobenZusatz'); |
67 store.sync(); | 67 var pzsId = sprobenZusatz.pzsId; |
68 var probeId = selection.get('probeId'); | |
69 var deleteUrl = selection.getProxy().url + "/" + pzsId + "/" + probeId; | |
70 Ext.Ajax.request({ | |
71 url: deleteUrl, | |
72 method: 'DELETE', | |
73 success: function(response, opts) { | |
74 store.reload(); | |
75 } | |
76 }); | |
68 console.log('Deleting Kommentar'); | 77 console.log('Deleting Kommentar'); |
69 } else { | 78 } else { |
70 console.log('Cancel Deleting Kommentar'); | 79 console.log('Cancel Deleting Kommentar'); |
71 } | 80 } |
72 }); | 81 }); |