mayvn
mayvn

Reputation: 191

Bootbox HTML Render

What is the proper method to render HTML into a bootbox callback function?

The problem I'm running into is that I'm trying to make an HTML email on the callback and none of the HTML tags are rendering properly.

callback: function () {
   var text = "Greetings,<br /><br />" +

Thanks in advance.

Upvotes: 1

Views: 921

Answers (1)

Billybobbonnet
Billybobbonnet

Reputation: 3226

Try to use Blaze.renderWithData or just Blaze.render to load a template containing your html inside the bootbox. Here is an example

bootbox.dialog({
        message: "<div id='dialogAnchor'></div>",//I am not sure if it will be found. 
                                                 //You can just set your anchor div in the parent document
        title: "Such a nice modal!",
        animate: true,
        buttons: {
            danger: {
                label: 'cancel',
                className: "btn-default",
                callback: function() {

                }
            },
            success: {
                label:'done',
                className: "btn-success",
                callback: function() {
                    Blaze.renderWithData(Template.YourHTML, {email:this.content}, $("#dialogAnchor")[0]);
                    //or alternatively
                    Blaze.render(Template.YourHTML, $("#dialogAnchor")[0]);
                }}
            }});

Upvotes: 2

Related Questions