<script src="path/to/jquery.js"></script>
<script src="path/to/bootstrap.js"></script>
<script src="path/to/bootstrap-confirmation.js"></script>
Ich benutze Bootstrap-Bestätigung.Bootstrap-Bestätigung funktioniert nicht wegen Knopf onclick
Dies funktioniert nicht:
<a class="btn btn-danger btn-xs" data-toggle="confirmation"
onclick="DeleteUser(this);" data-id="10"><span class="fa fa-plus">
</span> Delete</a>
Dies funktioniert gleiche Seite:
<button class="btn btn-default" data-
toggle="confirmation">Confirmation</button>
<a class="btn btn-default" data-toggle="confirmation">Confirmation1</a>
Meine Bestätigung Einstellungen Dokument bereit
$('[data-toggle="popover"]').popover({ placement: 'left', html: true, trigger: 'hover' });
$('[data-toggle=confirmation]').confirmation({ btnOkLabel: 'Yes', btnCancelLabel: 'No', title: 'Are you sure?' });
UPDATE Meine Ajax löschen Funktion:
function DeleteUser(ele) {
var id = $(ele).attr('data-id');
$.ajax({
type: 'POST',
cache: false,
url: '../ashx/FriendOperation.ashx',
data: { id: id, rol: ' ' ,op:<%=(int)CrudOp.Delete%>},
beforeSend: function() {
//bla bla
},
success: function (data) {
var jsonData = JSON.parse(data);
if (jsonData != null) {
if (parseInt(jsonData) > 0) {
alert('okey');
GetFriendOp();
} else {
alert('expception');
}
} else {
alert('expception');
}
}
});
}
Kann ich mit AJAX kombinieren wie $('#element').confirmation('show');
ERFOLG.
$ ("[Daten-Toggle = Bestätigung]") Bestätigung ({btnOkLabel: 'Ja', btnCancelLabel : 'Nein', Titel: 'Bist du sicher?', Container: "body", btnOkClass: "btn btn-sm btn-erfolg btn-xs", btnCancelClass: "btn btn-sm btn-danger btn-xs", onConfirm: function (event, element) {Warnung ('confirm clicked'); }});
Dank @DanCouper.
hmm du hast Recht, überschreibe ich die Bestätigung kann ich auf Ajax irgendwo wie $ ('element) .confirmation (' show '); kombinieren? –
Unter "Optionen" hier: http://bootstrap-confirmation.js.org/ gibt es einen für onConfirm - also würden Sie '.confirmation ({onConfirm (e) {... hier Sachen}}. Es sollte sei grundsätzlich so - lass dich aber mit den Optionen herumalbern - schreibe es wie das Beispiel über den Optionen (geht in das '$ ('[data-toggle = confirmation]'). confirmation ....' setup call) – DanCouper
Ich bekomme es und update Lösung :) Danke. –