Skip to content

Commit

Permalink
Improve README.md for nate-strauser#28
Browse files Browse the repository at this point in the history
  • Loading branch information
openp2pdesign committed Dec 29, 2017
1 parent 66656d5 commit 69185ac
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,25 @@ 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:

```html
<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:

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

See also the [Select2 documentation](https://select2.org/).

0 comments on commit 69185ac

Please sign in to comment.