Skip to content

A simple dual multiselect directive with filtering. Uses Angular and Bootstrap.

Notifications You must be signed in to change notification settings

catamaican/angular-dual-multiselect-directive

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular Dual Multiselect Directive

###Filter, select, go! The Angular Dual Multiselect Directive makes it easy to quickly create a pair of searchable fields for selecting multiple options from a large set of values.

Screenshot

###Dependencies

  • AngularJS (angular.min.js) (tested with 1.3.13 and 1.4.0-beta.1)
  • Bootstrap (at least the CSS)

###Demo

###Usage

####Include the CSS and JS files. Make sure Angular and your app.js files are included first.

<link rel="stylesheet" href="assets/dualmultiselect.css">
<script src="assets/dualmultiselect.js"></script>

####Add the directive tag in your HTML.

<dualmultiselect options="demoOptions"> </dualmultiselect>

####Add/customize this set of options as an object in your controller scope. Note the comments for the last properties.

$scope.demoOptions = {
	title: 'Demo: Recent World Cup Winners',
	filterPlaceHolder: 'Start typing to filter the lists below.',
	labelAll: 'All Items',
	labelSelected: 'Selected Items',
	helpMessage: ' Click items to transfer them between fields.',
	/* angular will use this to filter your lists */
	orderProperty: 'name',
	/* this contains the initial list of all items (i.e. the left side) */
	items: [{'id': '50', 'name': 'Germany'}, {'id': '45', 'name': 'Spain'}, {'id': '66', 'name': 'Italy'}, {'id': '30', 'name' : 'Brazil' }, {'id': '41', 'name': 'France' }, {'id': '34', 'name': 'Argentina'}],
	/* this list should be initialized as empty or with any pre-selected items */
	selectedItems: [] 
};	

####TODO

  • Pressing enter key automatically moves the top item in the "all" pool over to the "selected" pool.

####License WTFPL License

About

A simple dual multiselect directive with filtering. Uses Angular and Bootstrap.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 78.7%
  • CSS 21.3%