Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kanety/jquery-simple-multi-select
https://github.com/kanety/jquery-simple-multi-select
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kanety/jquery-simple-multi-select
- Owner: kanety
- License: mit
- Created: 2019-12-01T10:00:38.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-23T02:00:55.000Z (almost 4 years ago)
- Last Synced: 2024-12-25T04:04:43.704Z (23 days ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# jquery-simple-multi-select
A jquery plugin for multiple select.
## Dependencies
* jquery
## Installation
Install from npm:
$ npm install @kanety/jquery-simple-multi-select --save
## Usage
Build two select elements as follows:
```html
option1
option2
option3
option4
option5
```Then run:
```javascript
$('#select').simpleMultiSelect({
source: '#src',
destination: '#dst',
adder: '#adder',
remover: '#remover'
});
```### Options
Set max number of addable options:
```javascript
$('#select').simpleMultiSelect({
...
maxOptions: 2
});
```Enable sorting when options moved:
```javascript
$('#select').simpleMultiSelect({
...
sortOptions: true
});
```### Callbacks
```javascript
$('#select').simpleMultiSelect({
...
}).on('option:added', function(e, $option) {
...
}).on('option:removed', function(e, $option) {
...
});
```## License
The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).