Skip to content

Add custom attributes for dialog buttons #880

@ucscode

Description

@ucscode
bootbox.dialog({ 
    message: '<p>This dialog demonstrates many of the options available when using the Bootbox library</p>',
    ..., // other options
    buttons: {
        myButton: {
            label: 'Fee',
            className: 'btn-primary',
            // allow custom attributes
            attrs: {
                 "data-value": "my custom value",
                 "data-trigger": "#some-custom-trigger",
            },
            callback: function () {
                // 
            },
        },
    }
});
<div class="modal-dialog">
    ...
    <button class="btn btn-primary" data-value="my custom value" data-trigger="#some-custom-trigger">Fee</button>
</div>

Allow users to set custom attribute on the buttons declared in dialog box.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions