Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kanety/jquery-simple-multi-select


https://github.com/kanety/jquery-simple-multi-select

Last synced: 8 days ago
JSON representation

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).