Does anyone have a working example of upon any specific event, creating a dnnConfirm dialog, and initiating to show on the page with callbacks?
I've tried several iterations of this, to no avail... :(
jQuery(elem).dnnConfirm({
text: "Are you sure you want to delete this?",
yesText: "Yes",
noText: "No",
title: "Delete Confirmation",
callbackTrue: function() {
if (session.SessionId > 0) {
factory.callDeleteService("DeleteSession", session.SessionId)
.success(function(data) {
var deleteResponse = angular.fromJson(data);
console.log("deleteResponse.Content = " + deleteResponse.Content);
$scope.RemoveSession(session);
})
.error(function(data, status) {
$scope.HasErrors = true;
console.log("Unknown error occurred calling DeleteSession");
console.log(data);
});
} else {
$scope.RemoveSession(session);
}
return true;
},
callbackFalse: function() {
return false;
}
});
jQuery(elem).trigger("click");
jQuery(elem).click(function(e) {
return;
});
I've removed some of the code and replaced it with comments to make this sample more readable.
The only thing that code sample appears to be doing successfully is preventing the DOM elements from being deleted. I can step through to see trigger() and click() executed, but nothing else that I expect to happen occurs.