- Posted On 16 December 2014
- By
- In Programming
This post covers information about how to implement Bootstrap Multiselect jQuery plugin in HTML with different options such as filter and select all functionality.
Many of the application now days requires such kind of multiselect option which provides easy input facility for the user. Let's see how to implement this plugin.
First of all you need a reference files of bootstrap and jQuery included in your application or page then you need to include reference bootstrap-multiselect.js and bootstrap-multiselect.css which you can download from here.
Then suppose you have defined a HTML mark up for select options like below.
<select id="ddlCars" multiple="multiple"> <option value="Accord">Accord</option> <option value="Duster">Duster</option> <option value="Esteem">Esteem</option> <option value="Fiero">Fiero</option> <option value="Lancer">Lancer</option> <option value="Phantom">Phantom</option> </select>
Now you need to call jQuery code like following to convert this normal select to multiselect.
$('#ddlCars').multiselect();
That's it. Now if you run your site or page you will find an awesome multiselect i.e. dropdown with checkbox list.
This plugin has several inbuilt properties and method to get this control worked in most kind of functionality, out of which below are some frequently needed properties.
numberDisplayed : This property controls after how much items control start displaying "..Selected" Text.
includeSelectAllOption : This flag allows you to provide select all functionality within the control.
enableFiltering : This flag allows you to provide search box to filter items.
nonSelectedText : This property allows you to change the default "None Selected" text when no items selected to any custom text.
Below is the live working fiddle with all above functionalities.
Let me know your opinion about this plugin and do share if you know any other better plugin. Thanks.
- Tags :
- ASP.NET
- MVC
- jQueryJavascript
Top 10 Visual Studio things which can boost developers coding speed
Visual Studio 2012 provides some coding features by which you can code faster if use them properly. This post will cover top 10 things among them to boost your development speed.
Visual Studio 2008 Shell and TFS integration
Visual Studio 2008 Shell and TFS integration is the problem for all newbies of BIDS and TFS. Here is the solution.
How to call click or any event only once in jQuery
Know how to execute an click event or any event only once for any element in jQuery. Perform action only once and even not required to unbind event.
Assembla - Free and private repository to manage your source code online with SVN subversion hosting
With Assembla you can share source code with others online. Free & Private source code repository with SVN Subversion, Git & Perforce Hosting.
Best CSS Gradient background generator tools online
Here are some best CSS gradient background code generator online tools using which you can create a cross browser css code for gradient backgrounds.