Customizable options of this plugin.
- multiple
- maxHeight
- buttonClass
- buttonContainer
- buttonWidth
- buttonText
- buttonTitle
- nonSelectedText
- nSelectedText
- allSelectedText
- numberDisplayed
- delimiterText
- optionLabel
- optionClass
- selectedClass
- includeSelectAllOption
- selectAllJustVisible
- selectAllText
- selectAllValue
- selectAllName
- selectAllNumber
- onSelectAll
- onDeselectAll
- enableFiltering
- enableCaseInsensitiveFiltering
- enableFullValueFiltering
- filterBehavior
- filterPlaceholder
First of all you need to add the fllowing libraries in your web page's head tag .
- jQuery
- Twitter Boostrap
- <!-- Include Twitter Bootstrap and jQuery: -->
- <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"/>
- <script type="text/javascript" src="js/jquery.min.js"></script>
- <script type="text/javascript" src="js/bootstrap.min.js"></script>
- <!-- Include the plugin's CSS and JS: -->
- <script type="text/javascript" src="js/bootstrap-multiselect.js">
- </script>
- <link rel="stylesheet" href="css/bootstrap-multiselect.css"
- type="text/css"/>
Then you can create a select and add the plugin to it.
- <select id="exampleOne" multiple="multiple">
- <option value="Colombo">Colombo</option>
- <option value="London">London</option>
- <option value="Sydney">Sydney</option>
- <option value="Tokyo">Tokyo</option>
- <option value="Paris">Paris</option>
- </select>
Now Call the plugin in your javaScript section.
- <!-- Initialize the plugin: -->
- <script type="text/javascript">
- $(document).ready(function() {
- $('#exampleOne').multiselect();
- });
- </script>
We also can use this as a single select with radio buttons.
select initialization.
I will explain about more features of this plugin in my next posts.
Byeee :)
great sis ^_^
ReplyDeleteThank u Iresha :)
Delete