nate-strauser / meteor-select2

Select2 bindings to meteor
MIT License
30 stars 24 forks source link

Select2

Package for Select2

How to install

Add package

meteor add natestrauser:select2

How to use

Add a specific class in your template for the select element you want to apply Select2 to:

<select class="select2-dropdown" name="state">
  <option value="value1">value1</option>
  <option value="value2">value2</option>
</select>

Enable Select2 for the specific class in the .js file of your template:

Template.MyTemplate.onRendered(function() {
    // Enable select2
    $('.select2-dropdown').select2();
});

See also the Select2 documentation.