- Posted On 16 December 2014
- 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.
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.
Typewriter - Automatic TypeScript Template generation from C# classes in Visual Studio
Typewriter, an extension for visual studio that generates TypeScript files from C# code files using TypeScript templates. Convert your C# model classes to TypeScript automatically.
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.
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.
Copy changed data in table from one database to another in SQL stored procedure
How to copy or merge changed data in table from one database to another having same schema is the topic of this post.
Speed up coding in Visual Studio with code snippets & samples at your fingertips
Know how you can speed up coding in Visual Studio with Bing Developer Assistant by having millions of code snippets and sample projects at fingertips.