HubSpot / vex

A modern dialog library which is highly configurable and easy to style. #hubspot-open-source
http://github.hubspot.com/vex/docs/welcome
MIT License
6.92k stars 494 forks source link

[Question] How to append HTML5 into vex dialog? #225

Closed MaxJeong closed 7 years ago

MaxJeong commented 7 years ago

So I programmatically generated a HTML5 code and been trying to append that to vex dialog. My vex code looks like this:

vex.dialog.open({
            overlayClosesOnClick: true,
            message: $('#widgetlist').clone(),
            callback: function (value){
                if (value) {
                    return;
                } else {
                    return;
                }
            }.bind(this)
        })

and the HTML5 code that I'm trying to append looks like this:

<div id='widgetlist'>
<label>Messenger</label>
<label>Discord</label>
</div>

Using the clone function returns a jQuery object according to the console log so my vex popup returns with the popup with the message [object Object] instead of generating the HTML.

I also tried putting an empty div with id in the message option and appended the HTML outside the vex code but that didn't recognize the div within the vex code.