comparison app/controller/Orte.js @ 217:4db982514a5f

Fixed issue21
author Torsten Irländer <torsten.irlaender@intevation.de>
date Mon, 15 Jul 2013 16:30:52 +0200
parents 6aedf2026fb4
children 73a2c114db64
comparison
equal deleted inserted replaced
216:6aedf2026fb4 217:4db982514a5f
100 var grid = button.up('grid'); 100 var grid = button.up('grid');
101 var selection = grid.getView().getSelectionModel().getSelection()[0]; 101 var selection = grid.getView().getSelectionModel().getSelection()[0];
102 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){ 102 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){
103 if(btn === 'yes'){ 103 if(btn === 'yes'){
104 var store = grid.getStore(); 104 var store = grid.getStore();
105 store.remove(selection); 105 var deleteUrl = selection.getProxy().url + selection.getEidi();
106 store.sync(); 106 Ext.Ajax.request({
107 console.log('Deleting Kommentar'); 107 url: deleteUrl,
108 method: 'DELETE',
109 success: function(response, opts) {
110 store.reload();
111 }
112 });
113 console.log('Deleting Ort');
108 } else { 114 } else {
109 console.log('Cancel Deleting Kommentar'); 115 console.log('Cancel Deleting Ort');
110 } 116 }
111 }); 117 });
112 }, 118 },
113 createSuccess: function(form, record, operation) { 119 createSuccess: function(form, record, operation) {
114 // Reload store 120 // Reload store

http://lada.wald.intevation.org