Skip to content

a jQuery plugin to provid multiple-select function through 2 List-Boxes

Notifications You must be signed in to change notification settings

namo-R/DualSelectList

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bala.DualSelectList

bala.DualSelectList is a jQuery plugin to provid multiple-select function through 2 List-Boxes.

How to use:

1. Create DualSelectList with candidate items and default color

var dsl = $('#dualSelectExample').DualSelectList({
	'candidateItems' : ['Item 01', 'Item 02', 'Item 03', 'Item 04', 'Item 05', 'Item 06', 'Item 07'],
	'selectionItems' : ['Item 08', 'Item 09', 'Item 10'],
	'colors' : {
		'itemText' : 'white',
		'itemBackground' : 'rgb(0, 51, 204)',
		'itemHoverBackground' : '#0066ff'
	}
});

These strings can be used as color name:

Color Name Discription
panelBackground Set / Reset the background-color feature of panel
filterText Set / Reset the color feature of filter
itemText Set / Reset the color feature of item
itemBackground Set / Reset the background-color feature of item
itemHoverBackground Set / Reset the background-color feature of item when mouse over
itemPlaceholderBackground Set / Reset the background-color feature of item placeholder
itemPlaceholderBorder Set / Reset the border-color feature of item placeholder

2. Set candidate / selection items after DualSelectList created

var dsl = $('#dualSelectExample').DualSelectList();
dsl.setCandidate(['Item 01', 'Item 02', 'Item 03', 'Item 04', 'Item 05']);
dsl.setSelection(['Item 06', 'Item 07', 'Item 08', 'Item 09', 'Item 10']);

3. Set / Reset item color after DualSelectList created

var dsl = $('#dualSelectExample').DualSelectList();
dsl.setColor('panelBackground', 'yellow');
dsl.resetColor('panelBackground');

The color names list in (1) can be used as the first parameter. Using resetColor('') to reset all color.

4. Get select result

var res = dsl.getSelection();

The jQuery Plugin Registry is now in read-only mode. https://plugins.jquery.com/

About

a jQuery plugin to provid multiple-select function through 2 List-Boxes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 71.7%
  • HTML 16.9%
  • CSS 11.4%