added delete button to entity info dialog

This commit is contained in:
Steffen Vogel 2011-07-20 14:17:12 +02:00
parent 11175bbcbb
commit 037cc28879
2 changed files with 28 additions and 1 deletions

View file

@ -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&uuml;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');
}
});
}
}
});
};

View file

@ -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);
};