added delete button to entity info dialog
This commit is contained in:
parent
11175bbcbb
commit
037cc28879
2 changed files with 28 additions and 1 deletions
|
@ -98,13 +98,32 @@ Entity.prototype.loadData = function() {
|
|||
* Show and edit entity details
|
||||
*/
|
||||
Entity.prototype.showDetails = function() {
|
||||
var entity = this;
|
||||
|
||||
$('<div>')
|
||||
.addClass('details')
|
||||
.append(this.getDOMDetails())
|
||||
.dialog({
|
||||
title: 'Details für ' + this.title,
|
||||
width: 480,
|
||||
resizable: false
|
||||
resizable: false,
|
||||
buttons : {
|
||||
'Schließen': function() {
|
||||
$(this).dialog('close');
|
||||
},
|
||||
'Löschen' : function() {
|
||||
vz.load({ // TODO encapsulate in own method
|
||||
controller: 'entity',
|
||||
context: this,
|
||||
identifier: entity.uuid,
|
||||
url: entity.middleware,
|
||||
type: 'DELETE',
|
||||
success: function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -79,6 +79,14 @@ vz.load = function(args) {
|
|||
|
||||
args.url += '.json';
|
||||
|
||||
if (args.data === undefined) {
|
||||
args.data = { };
|
||||
}
|
||||
|
||||
if (args.type) {
|
||||
args.data.operation = args.type.toLowerCase();
|
||||
}
|
||||
|
||||
return $.ajax(args);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue