jQuery Plugin For Multi Selection With Two Sides lwMultiSelect - Download jQuery Plugin For Multi Selection With Two Sides - lwMultiSelect

Download jQuery Plugin For Multi Selection With Two Sides – lwMultiSelect

Posted on

This time I will share jQuery Plugin and tutorial about jQuery Plugin For Multi Selection With Two Sides – lwMultiSelect, hope it will help you in programming stack.

jQuery Plugin For Multi Selection With Two Sides lwMultiSelect - Download jQuery Plugin For Multi Selection With Two Sides - lwMultiSelect
File Size: 12.4 KB
Views Total: 6791
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A lightweight multi select plugin for jQuery that transforms normal select element into dual select boxes with support for select all, remove all and click to add/remove.

How to use it:

1. Add references to jQuery library and the jQuery lwMultiSelect plugin’s files into the html page.

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <link href="jquery.lwMultiSelect.css" rel="stylesheet">
3 <script src="jquery.lwMultiSelect.js"></script>

2. Call the function lwMultiSelect on the target multi select element and the plugin will take care of the rest.

1 $('#selector').lwMultiSelect();

3. Set the label text.

1 $('#selector').lwMultiSelect({
2   addAllText: "Select All",
3   removeAllText: "Remove All",
4   selectedLabel: "Values accepted",
5 });

4. Specify the max number of entries allowed to be selected.

1 $('#selector').lwMultiSelect({
2   maxSelect: 0, //0 = no restrictions
3   maxText: '',
4 });

5. Fire a custom function on each change.

1 $('#selector').lwMultiSelect({
2   onChange: function() {
3     //do something
4   }
5 });

6. API methods.

01 // gets current values.
02 $('#selector').val();
03  
04 // up<a href="https://www.jqueryscript.net/time-clock/">date</a>s the select list
05 $('#selector').data('plugin_lwMultiSelect').updateList();
06  
07 // selects all visible item
08 $('#selector').data('plugin_lwMultiSelect').selectAll();
09  
10 // removes all selected items
11 $('#selector').data('plugin_lwMultiSelect').removeAll(); //remove all selected  items

This awesome jQuery plugin is developed by keyo321. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net