Twitter bootstrap 如何使用bootstrap popover与Selected?
什么是最好的方式来使用流星选择在一个府绸 我有一个日历,当我点击事件时,会打开一个弹出窗口,里面有一个小表单来更新事件 这是我的日历模板:Twitter bootstrap 如何使用bootstrap popover与Selected?,twitter-bootstrap,meteor,jquery-chosen,Twitter Bootstrap,Meteor,Jquery Chosen,什么是最好的方式来使用流星选择在一个府绸 我有一个日历,当我点击事件时,会打开一个弹出窗口,里面有一个小表单来更新事件 这是我的日历模板: <template name="bookingCalendar"> <section> <div class="col-md-12"> <div id="calendarMain"></div> </div> </section> {
<template name="bookingCalendar">
<section>
<div class="col-md-12">
<div id="calendarMain"></div>
</div>
</section>
{{> bookingCalendar_popover}}
</template>
我选择了这里
Template.objectIndividual_edit.rendered = function() {
var input = $('.objectIndividual');
input.chosen({disable_search_threshold: 10});
};
Template.objectIndividual_edit.helpers({
individuals: function(){
return Individual.find({deactivatedAt: {$exists: false}}, {sort: {firstName: 1, lastName: 1}});
}
});
如果未选择,则正确填写选择。但是当我使用select时,select被破坏了
因此,任何人都有这样做的想法或示例?类似于所选行为的行为需要在内容准备好后初始化。与模态事件类似,您可以使用popover事件:
$('#thing').popover(
// content, title, etc...
).on('shown.bs.popover', function () {
$('.chosen-select').chosen();
}).on('hidden.bs.popover', function () {
// Destroy when the popover is hidden otherwise it does not work if the popover is re-opened.
$('.chosen-select').chosen('destroy');
});
Template.bookingCalendar.rendered
Template.objectIndividual_edit.rendered = function() {
var input = $('.objectIndividual');
input.chosen({disable_search_threshold: 10});
};
Template.objectIndividual_edit.helpers({
individuals: function(){
return Individual.find({deactivatedAt: {$exists: false}}, {sort: {firstName: 1, lastName: 1}});
}
});
$('#thing').popover(
// content, title, etc...
).on('shown.bs.popover', function () {
$('.chosen-select').chosen();
}).on('hidden.bs.popover', function () {
// Destroy when the popover is hidden otherwise it does not work if the popover is re-opened.
$('.chosen-select').chosen('destroy');
});