[Lada-commits] [PATCH 3 of 3] Fixed delete call
Wald Commits
scm-commit at wald.intevation.org
Mon Jul 15 17:23:05 CEST 2013
# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1373901040 -7200
# Node ID 82f8b5638f260aced4d9248db972b1278aca0386
# Parent 1b5a0cb4fa6caa00062ce0e99b8032858e339f2e
Fixed delete call
diff -r 1b5a0cb4fa6c -r 82f8b5638f26 app/controller/Messwert.js
--- a/app/controller/Messwert.js Mon Jul 15 17:10:31 2013 +0200
+++ b/app/controller/Messwert.js Mon Jul 15 17:10:40 2013 +0200
@@ -50,17 +50,22 @@
console.log("Loaded Messwert with ID " + record.getId()); //outputs ID
},
deleteMesswert: function(button) {
- // Get selected item in grid
var grid = button.up('grid');
var selection = grid.getView().getSelectionModel().getSelection()[0];
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 Messwert');
} else {
- console.log('Cancel Deleting Kommentar');
+ console.log('Cancel Deleting Messwert');
}
});
},
More information about the Lada-commits
mailing list