Icons for bootbox js dialogs

twitter-bootstrap

Solution

You need to create a custom dialog and use the `icon` configuration option added in 2.1.0.

For example:

$(function () {
    $(".confirm-delete").click(function(e) {
        e.preventDefault();
        var id = $(this).data('id')
        bootbox.dialog("Remove this product?", [{
            "label" : "No",
            "icon"  : "icon-remove"
        }, {
            "label" : "Yes",
            "icon"  : "icon-ok icon-white",
            "callback": function() {
                deleteRecord(id);
            }
        }]);
    });     
});

Custom dialog example

Problem

Has anyone figured out how to add icons to the buttons in a bootbox.js dialog? I'd like to add icons to the "No" and "Yes" buttons in this function: ``` $(function () { $(".confirm-delete").click(function(e) { e.preventDefault(); var id = $(this).data('id') bootbox.confirm("Remove this product?", "No", "Yes", function(confirmed) { if(confirmed) { deleteRecord(id); } }); }); }); ```

Original source