mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
added confirmation dialog before delete
This commit is contained in:
@@ -186,21 +186,30 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, {
|
||||
console.debug( 'remove item ' + id );
|
||||
}
|
||||
|
||||
// TODO show confirmation dialog
|
||||
|
||||
var store = this.store;
|
||||
|
||||
var url = String.format( this.restRemoveUrlPattern, id );
|
||||
Ext.Ajax.request({
|
||||
url: url,
|
||||
method: 'DELETE',
|
||||
success: function(){
|
||||
store.reload();
|
||||
},
|
||||
failure: function(){
|
||||
alert( 'failure' );
|
||||
|
||||
Ext.MessageBox.show({
|
||||
title: 'Remove Item',
|
||||
msg: 'Remove Item "' + id + '"?',
|
||||
buttons: Ext.MessageBox.OKCANCEL,
|
||||
icon: Ext.MessageBox.QUESTION,
|
||||
fn: function(result){
|
||||
if ( result == 'ok' ){
|
||||
Ext.Ajax.request({
|
||||
url: url,
|
||||
method: 'DELETE',
|
||||
success: function(){
|
||||
store.reload();
|
||||
},
|
||||
failure: function(){
|
||||
alert( 'failure' );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user