Bootstrap extended for multi select splitter
npm install bootstrap-multiselectsplitterHTML
`
Installation
`
npm i bootstrap-multiselectsplitter
`
Usage
Create a <select> with at least one <optgroup>.
Each <option> of your <select> must have a unique value.
`HTML
`
`JavaScript
$('select').multiselectsplitter();
$('select').multiselectsplitter('enable');
$('select').multiselectsplitter('disable');
$('select').multiselectsplitter('destroy');
`
Examples
Online demo
Options
* selectSize - define size of new selects ... when null, automatically setted by longest option count DEFAULT: null
* maxSelectSize - define max size of new selects DEFAULT: null
* clearOnFirstChange - when true, second select will be cleared when the first changes DEFAULT: false
* onlySameGroup - when true, only options from one optGroup can be selected (option works only for multiselect) DEFAULT: false
* groupCounter - when true, there will be added counter of how many options are selected (option works only for multiselect) DEFAULT: false
* maximumSelected - define how many options can be selected. Can be integer or function with arguments ($firstSelect, $secondSelect) that return integer. (option works only for multiselect) DEFAULT: null
* afterInitialize - function with 2 arguments ($firstSelect, $secondSelect) - called after initialization DEFAULT: null
* maximumAlert - function called when selected more than 'maximumSelected' options ... DEFAULT: function (maximumSelected) { alert("Only " + maximumSelected + " values can be selected"); }
* createFirstSelect - function for creating option in first select DEFAULT: function (label, $originalSelect) { return ''; }
* createSecondSelect - function for creating option in second select DEFAULT: function (label, $firstSelect) { return ''; }
* template - template for new selects DEFAULT: