Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dubbs/bootstrap-select-to-button
https://github.com/dubbs/bootstrap-select-to-button
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dubbs/bootstrap-select-to-button
- Owner: dubbs
- License: mit
- Created: 2015-12-11T03:15:35.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-25T22:04:34.000Z (over 8 years ago)
- Last Synced: 2025-01-10T16:59:59.477Z (29 days ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Getting Started
This library requires [Bootstrap](http://getbootstrap.com/) and [jQuery](https://jquery.com/), include them as dependencies, then include the bootstrap select source file.
```html
```
### Initialize
The default settings should work for most projects.
```js
$('#select').bootstrapSelectToButton();
```If you require further customizations you'll have to set options. To see the full list of options, see `$.fn.bootstrapSelectToButton.defaults`.
#### Examples
##### Show search for 5 or more elements
```js
$('#select').bootstrapSelectToButton({
minItemsForSearch: 5
});
```##### Set button style
```js
$('#select').bootstrapSelectToButton({
classButtonStyle: 'btn-primary'
});
```## API
This library will listen to change events fired on the original select. To update the bootstrap button group, simply set properties on the original select using [prop](http://api.jquery.com/prop/) and call [change](http://api.jquery.com/change/).
### Disable select
```js
$('#select').prop('disabled', true).change();
```### Set option selected
```js
$('#select option:eq(3)').prop('selected', true).change();
```