小编Lin*_*Man的帖子

Bootbox确认对话框问题

不幸的是,文档Bootbox(http://paynedigital.com/2011/11/bootbox-js-alert-confirm-dialogs-for-twitter-bootstrap)没有教授如何调用确认对话框.由于在加载页面时始终显示文档窗口,因此在单击删除按钮调用时应出现错误.这是尝试失败的代码.

// show "false" does not work, the confirm window is showing when page is loaded.
$(function () {
bootbox.confirm("Confirm delete?", "No", "Yes", function(result) {
show: false
});     
});

// need show the confirm window when the user click in a button, how to call the confirm window?

<td><a class="icon-trash" onclick="bootbox.confirm();" href="{% url 'del_setor' setor.id %}" title="Delete"></a></td>
Run Code Online (Sandbox Code Playgroud)

如何仅在单击删除按钮时才设置此引导框?谢谢!

编辑 - 解决方案:

$(function () {
$("a#confirm").click(function(e) {
    e.preventDefault();
    var location = $(this).attr('href');
    bootbox.confirm("Confirm exclusion?", "No", "Yes", function(confirmed) {
        if(confirmed) …
Run Code Online (Sandbox Code Playgroud)

jquery twitter-bootstrap bootbox

13
推荐指数
1
解决办法
5万
查看次数

标签 统计

bootbox ×1

jquery ×1

twitter-bootstrap ×1