Ich benutze bootbox
Bibliothek. Ich habe einen Knopf mit dem Namen Delete
.Modal ist es mehrmals geöffnet
$('body').on("click", ".deleteDiagnostic", function() {
var id = $(this).attr("data-diagnosticID");
var currentRow = $(this).closest('tr');
bootbox.confirm("Are you sure want to delete?", function (result) {
if (result == true) {
//code here
}
});
});
Ich verwende auch PartialView
und die Seite, die Schaltfläche dynamisch geladen enthält wird. Manchmal, wenn ich klicke, ist die Bootbox mehrmals geöffnet und ich weiß nicht warum.
PS: Wenn ich PartialView
für erstes Mal lade es funktioniert perfekt, aber wenn ich PartialView
mehrere Male laden, dann bootbox
mehrmals auf button
Klick erscheint.
Ja, das funktioniert. Vielen Dank . –
Sehr erfreut! :) –