- Add bootbox to your app (via meteorite):
mrt add bootboxjs
- You can pass a DOM fragment to bootbox's dialog function. You can get a DOM fragment from
Spark.render(...)
Example:
bootbox.dialog(
Spark.render(Template.test),
[{
"label" : "Ok",
"class" : "btn-primary",
"callback": function() {}
},{
"label" : "Cancel",
"class" : "btn",
"callback": function() {}
}],
{
"header":"Some Dialog box",
"headerCloseButton":true,
"onEscape": function() {}
}
);
Bonus Example-- Rendering the html, but without any events:
bootbox.dialog(
Template.test({contextVar:'SomeValue'}), // Set your context values here
[{
"label" : "Ok",
"class" : "btn-primary",
"callback": function() {}
},{
"label" : "Cancel",
"class" : "btn",
"callback": function() {}
}],
{
"header":"Some Dialog box",
"headerCloseButton":true,
"onEscape": function() {}
}
);