完全に機能するsweeAlertプラグインを試しましたが、確認後にデフォルトのものを実行する方法がわかりません。
$(document).ready(function () {
function handleDelete(e){
e.preventDefault();
swal({
title: "Are you sure?",
text: "You will not be able to recover the delaer again!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete!",
closeOnConfirm: false
},
function (isConfirm) {
if (isConfirm) {
return true;
}
});
};
});
そしてボタン
<a href="{plink delete! $row->id_dealers}" class="delete" onclick"handleDelete(event);"> </a>
//{plink delete! $row->id_dealers} Nette -> calls php delete handler
私も試してみましたがunbind()
、off()
代わりにreturn false
、動作しません。以前にconfirm()
withreturn true
およびreturn false
inonclick
属性を使用しましたが、機能しますが、見栄えが悪くなります。