I use a modal with bootstrap, so I have a modal with 3 tabs. In one of this tab I have a select like this :
<div class="modal-body">
<ul class="nav nav-tabs" id="TabModal">
<li><a href="#onglet1" data-toggle="tab">Libre</a></li>
<li><a href="#onglet2" data-toggle="tab">Complexe</a></li>
<li><a href="#onglet3" data-toggle="tab">Questionnaire</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane" id="onglet1">
<span class="label label-primary">Choose your collections :</span><br /><br />
{{>eachCollections}}
{{#if collectionChoose 1}}
<label style="float:left;">Par : </label>
<select class="form-control" style="width:200px;float:left;" id="widgetFilterSelectPanelistes">
<option value="none">-- none --</option>
<option value="name">Name</option>
<option value="age">Age</option>
<option value="city">City</option>
</select>
{{>eachKeyPanelistes}}
{{#if panelistChoose "name"}}
<select class="form-control" style="width:200px;">
{{#each panelistes}}
<option value="{{name}}">{{nom}}</option>
{{/each}}
</select>
{{/if}}
{{else}}
{{#if collectionChoose 2}}
<p>participants</p>
{{/if}}
{{/if}}
In the modal I use a select and when I change the select value I show an other select etc ...
For this template I have a JS file like this :
Template.eachCollections.helpers({
collections : function () {
return Collec.find();
}
});
Template.eachCollections.events({
'change #eachCollectionsSelect' : function () {
var selected = document.getElementById('eachCollectionsSelect').value;
Session.set('selectedCollections', selected);
}
});
Template.widgetFilter.collectionChoose = function (param) {
return parseInt(Session.get('selectedCollections')) === param;
}
But when I trigge the event on the select change, the modal disepear...
Do you have a solution ?