I try to get the following code to work
//===== Dialogs =====//
$(".table a.delete").click(function (e) {
e.preventDefault();
bootbox.confirm("Are you sure?", function (confirmed) {
if (confirmed) {
var $el = $(this);
var $tr = $el.closest('tr');
var url = $el.closest('table').data('remove-url');
var id = $tr.data('id');
$tr.fadeOut(function () {
$el.remove();
$.post(url, { id: id }); // do the delete on the server
});
}
});
});
The bootbox is showing, but the code below if(confirmed) doesnt run.
$(this) inside the anonymous bootbox-method does not refer to what you think it does. The code inside if (confirmed) is executed but does not match anything.