Git Product home page Git Product logo

multiselect's Introduction

multiselect

jQuery multiselect plugin with two sides. The user can select one or more items and send them to the other side.

Requirements

  • jQuery 1.7 or higher

Quick start

Several quick start options are available:

  • Clone the repo: git clone https://github.com/crlcu/multiselect.git or
  • Install with Bower: bower install multiselect-two-sides.

Usage example

<div class="row">
	<div class="col-xs-5">
		<select name="from[]" id="multiselect" class="form-control" size="8" multiple="multiple">
			<option value="1">Item 1</option>
			<option value="3">Item 3</option>
			<option value="2">Item 2</option>
		</select>
	</div>
	
	<div class="col-xs-2">
		<button type="button" id="multiselect_rightAll" class="btn btn-block"><i class="glyphicon glyphicon-forward"></i></button>
		<button type="button" id="multiselect_rightSelected" class="btn btn-block"><i class="glyphicon glyphicon-chevron-right"></i></button>
		<button type="button" id="multiselect_leftSelected" class="btn btn-block"><i class="glyphicon glyphicon-chevron-left"></i></button>
		<button type="button" id="multiselect_leftAll" class="btn btn-block"><i class="glyphicon glyphicon-backward"></i></button>
	</div>
	
	<div class="col-xs-5">
		<select name="to[]" id="multiselect_to" class="form-control" size="8" multiple="multiple"></select>
	</div>
</div>
<script type="text/javascript" src="path/to/jquery.min.js"></script>
<script type="text/javascript" src="path/to/multiselect.min.js"></script>

<script type="text/javascript">
jQuery(document).ready(function($) {
	$('#multiselect').multiselect();
});
</script>

Bugs and feature requests

If your problem or idea is not addressed yet, please open a new issue.

Versioning

For transparency into release cycle and in striving to maintain backward compatibility, multiselect is maintained under the Semantic Versioning guidelines.

License

The multiselect plugin is open-sourced software licensed under the the MIT license.

multiselect's People

Contributors

adaosantos avatar billyeh avatar cpburnz avatar crlcu avatar dalgakiran avatar dependabot[bot] avatar diego-qgenda avatar efexen avatar johnmadrak avatar joshkg avatar kozikowskik avatar mcaskill avatar pagenoare avatar raisou avatar ralucaf avatar rriopel avatar saruspete avatar simonluppescu avatar tuliren avatar vfportero avatar wardzinskim avatar westhouseit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multiselect's Issues

top button alignment

There is a problem with the first button, it can be the undo or >> buttons, it shows a bit to the left not aligned with the others. I don't know if this problem is related to incompatibility with bootstrap 3 or no.

untitled

possible fixes

Thank you for your multiselect code!

Still testing this but these are a few things that caught my eye:

  1. upgrade to newer boostrap
  2. I'm not a jquery guy but the focus stays on the middle buttons when clicked
  3. possibly a way to automate the size='8' attribute

This is what I'm using for html

<div class="row">
    <div class="col-sm-5">
        <select name="from" id="multiselect" class="col-sm-12" size="12" multiple="multiple">
            <option value="1">Item 1</option>
            <option value="2">Item 5</option>
            <option value="2">Item 2</option>
            <option value="2">Item 4</option>
            <option value="3">Item 3</option>
        </select>
    </div>

    <div class="col-sm-2">
        <button type="button" id="multiselect_rightAll" class="btn btn-default btn-block"><i class="fa fa-fast-forward fa-fw"></i></button>
        <button type="button" id="multiselect_rightSelected" class="btn btn-default btn-block"><i class="fa fa-chevron-right fa-fw"></i></button>
        <button type="button" id="multiselect_leftSelected" class="btn btn-default btn-block"><i class="fa fa-chevron-left fa-fw"></i></button>
        <button type="button" id="multiselect_leftAll" class="btn btn-default btn-block"><i class="fa fa-fast-backward fa-fw"></i></button>
    </div>

    <div class="col-sm-5">
        <select name="to" id="multiselect_to" class="col-sm-12" size="12" multiple="multiple"></select>
    </div>
</div>

Size attribute of the select control doesn't change height

It appears that changing the size attribute doesn't affect the height of the control.
Is this a bug or expected?

select name="from[]" id="multiselect_search" runat="server" size="50" multiple="true"
As a work-around, I'm doing this with CSS.

select#multiselect_search {
    height: 300px;
}   

Thank you.

Using Ajax to Re-populate the Select List

I am using ajax to change the contents of the SELECT list options in the left side when a radio button is selected. I am successfully returning a new SELECT list to the multiselect without reloading the page. However, the list is dead. I am unable to get items to move from left to right. Also the list does not react to the Search entry. It seems like I need to re-initialize the multiselect in order to reset the data and activate the behaviors.

Here is what I am doing to change the contents of the SELECT list on the left.

Do I need to do something to get the behaviors working after reloading the left side in this manner?

$(function() {
$(".LoadListType").click(function() {
    dataString = "";
    $.ajax({
        type: "POST",
        url: "../_data/ajax_recipient_ddl.asp", 
        data: dataString,
        success: function(data) {
            $('#leftpanel').html('<input type="text" name="q" class="form-control" placeholder="Search..." />')
            .append(data)
        }
    });
});
});

Items are selected when posting page

When posting the page, items that are not selected in the select controls are automatically selected.

This is especially noticeable in IE either because the page posts back slightly slower, or because the selection of each item in the list takes a bit longer. In IE, I can watch each item highlight as it the 'selected' property is added to the option item.

Is this expected / necessary behavior? I'm wondering if it could be optional - or if we could choose to change the styling on the selected items (for post back only) so that they don't appear to be selected.

Thanks very much.

Search functionality not working in any version of IE

Hi. This is a great control.

The search functionality is not working in IE.
I checked your demo page and verified that this is not just happening on my web page.

Typing in the search field in IE doesn't result in immediate filtering.
Clicking enter while in the search field in IE 8+ doesn't have any effect.

Hopefully you'll be able to patch that. For now, I'm going to hide the search fields in IE to avoid problems.

Thanks,

startup remove doesn't seem to work

I'm sorry in advance if I am posting this in the wrong location but I couldn't figure out what to do. I like the plugin for Jquery but I'm having an issue. I'm using it in my java application and I managed to pass the full list of items to my jsp page and the selected list via a form to the jsp. The page renders will the fill list on the left with all the items selected that I want. But what I can't figure out how to do is to get the selected items rendered in the right. The way I read the documentation I thought startUp would default to remove which would remove the selected items from the left and put them in the right. My right select list has nothing in it. I appreciate any help on this.

jspCode.txt

Select few from single item

Hi,

Great plugin!
i am listing the available items and quantity on left box. i want to add a textbox and put some quantity of a single item to the right.

How can i check single item and its value and sort only few ?

Origin data in right select is not in request parameter

Hi, I like to use your multiselect plugin. But I have a problem.

I put some origin data in right select when server render the page:

<select multiple="multiple" id="multiselect_to" name="ids">
  <option value="1">test1</option>
  <option value="2">test2</option>
</select>

When I post the form include above selects to server, I found the origin data is not in the parameter of request. But the data I selected by clicking the "moveToRight" button is in request parameters.

I'm confused about this. Could you help me? Thanks.

Undo/redo weird behavior

  1. Go to the demo page;
  2. Play around with some other selects;
  3. Go to the undo/redo demo;
  4. Press the "undo" button several times;
  5. See how the elements from the previous selects are inserted into the undo/redo select.

Search very slow

If select have a large options "in my case 2000 options". The search freezer and very slow. Sory for my english.

Issues with keepRenderingSort

I am using the keepRenderingSort option and both lists have values at startup. This leads to somewhat sporadic behavior when moving items between the lists. It seems to add the moved item to the top or bottom of the list and the sort order flips from ascending to descending each time.

I'm not sure what is going on with the sort order flipping, but I have an idea of how to fix the issue with position. If you can assign position values to the items in the Left list, which starts out with all the values, then as you compare it to the right list, copy the position value to the matching items in the Right list before you remove them from the Left list. That way, as you move items back and forth, they will always have the correct position as defined by the original list.

If I get a chance, I will try to fix it and post the code here, but if you are able to take a look or provide any insight, that would be helpful.

Keep search box if there is an optgroup element

In the source code I saw the comment as below

// Functions
            init: function() {
                var self = this;

                // For the moment disable sort and search if there is a optgroup element
                if (self.$left.find('optgroup').length || self.$right.find('optgroup').length) {
                    self.callbacks.sort = false;
                    self.options.search = false;  // why?
                }
                // ...
 }

when will this be supported?

handlebars is killing control...

Very nice control.

We're running into problems when using Handlebars to render new sets of List Items in the left side Select list. Handlebars abruptly replaces the items and doesn't care about the events that are hooked up to those items.

...Is there a way we can Deactivate all of the multiSelect events or the control itself so we can cleanly reactivate it again once Handlebars has finished rendering new items in the left hand list.

Options in the source multiselect list are auto-selected and POSTed to the server when form is submitted

I have this plugin enabled on a select field named from_topics[], which has about 200 <option> elements. The select element on the right is named topics[]. When I press the form's submit button, all of the options are selected (even though they were not moved to the right), and therefore the POST to the server includes all of these values, which is not desired.

To work around this, I have to use jQuery to intercept the form submission event and de-select them:

$('#topics_from').closest('form').submit(function(e) {
  // hack to de-select the options in the source list so they are not submitted to the server
  $('#topics_from option').prop('selected', false);
});

I don't think the option elements in the source list should be selected when the submit button is pressed.
Thanks

Search

hi,

I downloaded latest release but could not find the search box for multiselect.

is it removed.?

Drag and drop or sortable

Is it possible to add drag and drop on select's options, something like jqueryui sortable or there is another
way?

Delay in posting form with 2.2.6

I love this plugin, but have a small question or two:

With 2.2.6 I'm seeing a delay from when I click my form's submit button, that I believe I didn't see with releases prior to 2.2.6.

In addition, the left (from[]) side now removes the select element prior to posting, which never appeared to happen with older versions.

Is there some clean-up going on before control is passed to the form handler? This delay can be around 500ms-1000ms. I cannot seem to prevent this. The select element (from[]) contains around 200 items.

Thanks in advance.

How do you get the value of a moved item?

I've tried console.log for the parameters and I get the following. Clearly there's an item selected, but it doesn't tell me anything about it.

{"0":{},"length":1,"prevObject":{"0":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"60":{},"61":{},"62":{},"63":{},"64":{},"65":{},"66":{},"67":{},"68":{},"69":{},"70":{},"71":{},"72":{},"73":{},"74":{},"75":{},"76":{},"77":{},"78":{},"79":{},"80":{},"81":{},"82":{},"83":{},"84":{},"85":{},"86":{},"87":{},"88":{},"89":{},"90":{},"91":{},"92":{},"93":{},"94":{},"95":{},"96":{},"97":{},"98":{},"99":{},"100":{},"101":{},"102":{},"103":{},"104":{},"105":{},"106":{},"107":{},"108":{},"109":{},"110":{},"111":{},"112":{},"113":{},"114":{},"115":{},"116":{},"117":{},"118":{},"119":{},"120":{},"121":{},"122":{},"123":{},"124":{},"125":{},"126":{},"127":{},"128":{},"129":{},"130":{},"131":{},"132":{},"133":{},"134":{},"135":{},"136":{},"137":{},"138":{},"139":{},"140":{},"141":{},"142":{},"143":{},"144":{},"145":{},"146":{},"147":{},"148":{},"149":{},"150":{},"151":{},"152":{},"153":{},"154":{},"155":{},"156":{},"157":{},"158":{},"159":{},"160":{},"161":{},"162":{},"163":{},"164":{},"165":{},"166":{},"167":{},"168":{},"169":{},"170":{},"171":{},"172":{},"173":{},"174":{},"175":{},"176":{},"177":{},"178":{},"179":{},"180":{},"181":{},"182":{},"183":{},"184":{},"185":{},"186":{},"187":{},"188":{},"189":{},"190":{},"191":{},"192":{},"193":{},"194":{},"195":{},"196":{},"197":{},"198":{},"199":{},"200":{},"201":{},"202":{},"203":{},"204":{},"205":{},"206":{},"207":{},"208":{},"209":{},"210":{},"211":{},"212":{},"213":{},"214":{},"215":{},"216":{},"217":{},"218":{},"219":{},"220":{},"221":{},"222":{},"223":{},"224":{},"225":{},"226":{},"227":{},"228":{},"229":{},"230":{},"231":{},"232":{},"233":{},"234":{},"235":{},"236":{},"237":{},"238":{},"239":{},"240":{},"241":{},"242":{},"243":{},"244":{},"245":{},"246":{},"247":{},"248":{},"249":{},"250":{},"251":{},"252":{},"253":{},"254":{},"255":{},"256":{},"257":{},"258":{},"259":{},"260":{},"261":{},"262":{},"263":{},"264":{},"265":{},"266":{},"267":{},"268":{},"269":{},"270":{},"271":{},"272":{},"273":{},"274":{},"275":{},"276":{},"277":{},"278":{},"279":{},"280":{},"281":{},"282":{},"283":{},"284":{},"285":{},"286":{},"287":{},"288":{},"289":{},"290":{},"291":{},"292":{},"293":{},"294":{},"295":{},"296":{},"297":{},"298":{},"299":{},"300":{},"301":{},"302":{},"303":{},"304":{},"305":{},"306":{},"307":{},"308":{},"309":{},"310":{},"311":{},"312":{},"313":{},"314":{},"315":{},"316":{},"317":{},"318":{},"319":{},"320":{},"321":{},"322":{},"323":{},"324":{},"325":{},"326":{},"327":{},"328":{},"329":{},"330":{},"331":{},"332":{},"333":{},"334":{},"335":{},"336":{},"337":{},"338":{},"339":{},"340":{},"341":{},"342":{},"343":{},"344":{},"345":{},"346":{},"347":{},"348":{},"349":{},"350":{},"351":{},"352":{},"353":{},"354":{},"355":{},"356":{},"357":{},"358":{},"359":{},"360":{},"361":{},"362":{},"363":{},"364":{},"365":{},"366":{},"367":{},"368":{},"369":{},"370":{},"371":{},"372":{},"373":{},"374":{},"375":{},"376":{},"377":{},"378":{},"379":{},"380":{},"381":{},"382":{},"383":{},"384":{},"385":{},"386":{},"387":{},"388":{},"389":{},"390":{},"391":{},"392":{},"393":{},"394":{},"395":{},"396":{},"397":{},"398":{},"399":{},"400":{},"401":{},"402":{},"403":{},"404":{},"405":{},"406":{},"407":{},"408":{},"409":{},"410":{},"411":{},"412":{},"413":{},"414":{},"415":{},"416":{},"417":{},"418":{},"419":{},"420":{},"421":{},"422":{},"423":{},"424":{},"425":{},"426":{},"427":{},"428":{},"429":{},"430":{},"431":{},"432":{},"433":{},"434":{},"435":{},"436":{},"437":{},"438":{},"439":{},"440":{},"441":{},"442":{},"443":{},"444":{},"445":{},"446":{},"447":{},"448":{},"449":{},"450":{},"451":{},"452":{},"453":{},"454":{},"455":{},"456":{},"457":{},"458":{},"459":{},"460":{},"461":{},"462":{},"463":{},"464":{},"465":{},"466":{},"467":{},"468":{},"469":{},"470":{},"471":{},"472":{},"473":{},"474":{},"475":{},"476":{},"477":{},"478":{},"479":{},"480":{},"481":{},"482":{},"483":{},"484":{},"485":{},"486":{},"487":{},"488":{},"489":{},"490":{},"491":{},"492":{},"493":{},"494":{},"495":{},"496":{},"497":{},"498":{},"499":{},"500":{},"501":{},"502":{},"503":{},"504":{},"505":{},"506":{},"507":{},"508":{},"509":{},"510":{},"511":{},"512":{},"513":{},"514":{},"515":{},"516":{},"517":{},"518":{},"519":{},"520":{},"521":{},"522":{},"523":{},"524":{},"525":{},"526":{},"527":{},"528":{},"529":{},"530":{},"531":{},"532":{},"533":{},"534":{},"535":{},"536":{},"537":{},"538":{},"539":{},"540":{},"541":{},"542":{},"543":{},"544":{},"545":{},"546":{},"547":{},"548":{},"549":{},"550":{},"551":{},"552":{},"553":{},"554":{},"555":{},"556":{},"557":{},"558":{},"559":{},"560":{},"561":{},"562":{},"563":{},"564":{},"565":{},"566":{},"567":{},"568":{},"569":{},"570":{},"571":{},"572":{},"jQuery19005749572201166302":75,"sizzle-1454927918572":{"parentNode":["11 8",true]}},"context":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"60":{},"61":{},"62":{},"63":{},"64":{},"65":{},"66":{},"67":{},"68":{},"69":{},"70":{},"71":{},"72":{},"73":{},"74":{},"75":{},"76":{},"77":{},"78":{},"79":{},"80":{},"81":{},"82":{},"83":{},"84":{},"85":{},"86":{},"87":{},"88":{},"89":{},"90":{},"91":{},"92":{},"93":{},"94":{},"95":{},"96":{},"97":{},"98":{},"99":{},"100":{},"101":{},"102":{},"103":{},"104":{},"105":{},"106":{},"107":{},"108":{},"109":{},"110":{},"111":{},"112":{},"113":{},"114":{},"115":{},"116":{},"117":{},"118":{},"119":{},"120":{},"121":{},"122":{},"123":{},"124":{},"125":{},"126":{},"127":{},"128":{},"129":{},"130":{},"131":{},"132":{},"133":{},"134":{},"135":{},"136":{},"137":{},"138":{},"139":{},"140":{},"141":{},"142":{},"143":{},"144":{},"145":{},"146":{},"147":{},"148":{},"149":{},"150":{},"151":{},"152":{},"153":{},"154":{},"155":{},"156":{},"157":{},"158":{},"159":{},"160":{},"161":{},"162":{},"163":{},"164":{},"165":{},"166":{},"167":{},"168":{},"169":{},"170":{},"171":{},"172":{},"173":{},"174":{},"175":{},"176":{},"177":{},"178":{},"179":{},"180":{},"181":{},"182":{},"183":{},"184":{},"185":{},"186":{},"187":{},"188":{},"189":{},"190":{},"191":{},"192":{},"193":{},"194":{},"195":{},"196":{},"197":{},"198":{},"199":{},"200":{},"201":{},"202":{},"203":{},"204":{},"205":{},"206":{},"207":{},"208":{},"209":{},"210":{},"211":{},"212":{},"213":{},"214":{},"215":{},"216":{},"217":{},"218":{},"219":{},"220":{},"221":{},"222":{},"223":{},"224":{},"225":{},"226":{},"227":{},"228":{},"229":{},"230":{},"231":{},"232":{},"233":{},"234":{},"235":{},"236":{},"237":{},"238":{},"239":{},"240":{},"241":{},"242":{},"243":{},"244":{},"245":{},"246":{},"247":{},"248":{},"249":{},"250":{},"251":{},"252":{},"253":{},"254":{},"255":{},"256":{},"257":{},"258":{},"259":{},"260":{},"261":{},"262":{},"263":{},"264":{},"265":{},"266":{},"267":{},"268":{},"269":{},"270":{},"271":{},"272":{},"273":{},"274":{},"275":{},"276":{},"277":{},"278":{},"279":{},"280":{},"281":{},"282":{},"283":{},"284":{},"285":{},"286":{},"287":{},"288":{},"289":{},"290":{},"291":{},"292":{},"293":{},"294":{},"295":{},"296":{},"297":{},"298":{},"299":{},"300":{},"301":{},"302":{},"303":{},"304":{},"305":{},"306":{},"307":{},"308":{},"309":{},"310":{},"311":{},"312":{},"313":{},"314":{},"315":{},"316":{},"317":{},"318":{},"319":{},"320":{},"321":{},"322":{},"323":{},"324":{},"325":{},"326":{},"327":{},"328":{},"329":{},"330":{},"331":{},"332":{},"333":{},"334":{},"335":{},"336":{},"337":{},"338":{},"339":{},"340":{},"341":{},"342":{},"343":{},"344":{},"345":{},"346":{},"347":{},"348":{},"349":{},"350":{},"351":{},"352":{},"353":{},"354":{},"355":{},"356":{},"357":{},"358":{},"359":{},"360":{},"361":{},"362":{},"363":{},"364":{},"365":{},"366":{},"367":{},"368":{},"369":{},"370":{},"371":{},"372":{},"373":{},"374":{},"375":{},"376":{},"377":{},"378":{},"379":{},"380":{},"381":{},"382":{},"383":{},"384":{},"385":{},"386":{},"387":{},"388":{},"389":{},"390":{},"391":{},"392":{},"393":{},"394":{},"395":{},"396":{},"397":{},"398":{},"399":{},"400":{},"401":{},"402":{},"403":{},"404":{},"405":{},"406":{},"407":{},"408":{},"409":{},"410":{},"411":{},"412":{},"413":{},"414":{},"415":{},"416":{},"417":{},"418":{},"419":{},"420":{},"421":{},"422":{},"423":{},"424":{},"425":{},"426":{},"427":{},"428":{},"429":{},"430":{},"431":{},"432":{},"433":{},"434":{},"435":{},"436":{},"437":{},"438":{},"439":{},"440":{},"441":{},"442":{},"443":{},"444":{},"445":{},"446":{},"447":{},"448":{},"449":{},"450":{},"451":{},"452":{},"453":{},"454":{},"455":{},"456":{},"457":{},"458":{},"459":{},"460":{},"461":{},"462":{},"463":{},"464":{},"465":{},"466":{},"467":{},"468":{},"469":{},"470":{},"471":{},"472":{},"473":{},"474":{},"475":{},"476":{},"477":{},"478":{},"479":{},"480":{},"481":{},"482":{},"483":{},"484":{},"485":{},"486":{},"487":{},"488":{},"489":{},"490":{},"491":{},"492":{},"493":{},"494":{},"495":{},"496":{},"497":{},"498":{},"499":{},"500":{},"501":{},"502":{},"503":{},"504":{},"505":{},"506":{},"507":{},"508":{},"509":{},"510":{},"511":{},"512":{},"513":{},"514":{},"515":{},"516":{},"517":{},"518":{},"519":{},"520":{},"521":{},"522":{},"523":{},"524":{},"525":{},"526":{},"527":{},"528":{},"529":{},"530":{},"531":{},"532":{},"533":{},"534":{},"535":{},"536":{},"537":{},"538":{},"539":{},"540":{},"541":{},"542":{},"543":{},"544":{},"545":{},"546":{},"547":{},"548":{},"549":{},"550":{},"551":{},"552":{},"553":{},"554":{},"555":{},"556":{},"557":{},"558":{},"559":{},"560":{},"561":{},"562":{},"563":{},"564":{},"565":{},"566":{},"567":{},"568":{},"569":{},"570":{},"571":{},"572":{},"jQuery19005749572201166302":75,"sizzle-1454927918572":{"parentNode":["11 8",true]}},"length":1},"context":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{},"10":{},"11":{},"12":{},"13":{},"14":{},"15":{},"16":{},"17":{},"18":{},"19":{},"20":{},"21":{},"22":{},"23":{},"24":{},"25":{},"26":{},"27":{},"28":{},"29":{},"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{},"47":{},"48":{},"49":{},"50":{},"51":{},"52":{},"53":{},"54":{},"55":{},"56":{},"57":{},"58":{},"59":{},"60":{},"61":{},"62":{},"63":{},"64":{},"65":{},"66":{},"67":{},"68":{},"69":{},"70":{},"71":{},"72":{},"73":{},"74":{},"75":{},"76":{},"77":{},"78":{},"79":{},"80":{},"81":{},"82":{},"83":{},"84":{},"85":{},"86":{},"87":{},"88":{},"89":{},"90":{},"91":{},"92":{},"93":{},"94":{},"95":{},"96":{},"97":{},"98":{},"99":{},"100":{},"101":{},"102":{},"103":{},"104":{},"105":{},"106":{},"107":{},"108":{},"109":{},"110":{},"111":{},"112":{},"113":{},"114":{},"115":{},"116":{},"117":{},"118":{},"119":{},"120":{},"121":{},"122":{},"123":{},"124":{},"125":{},"126":{},"127":{},"128":{},"129":{},"130":{},"131":{},"132":{},"133":{},"134":{},"135":{},"136":{},"137":{},"138":{},"139":{},"140":{},"141":{},"142":{},"143":{},"144":{},"145":{},"146":{},"147":{},"148":{},"149":{},"150":{},"151":{},"152":{},"153":{},"154":{},"155":{},"156":{},"157":{},"158":{},"159":{},"160":{},"161":{},"162":{},"163":{},"164":{},"165":{},"166":{},"167":{},"168":{},"169":{},"170":{},"171":{},"172":{},"173":{},"174":{},"175":{},"176":{},"177":{},"178":{},"179":{},"180":{},"181":{},"182":{},"183":{},"184":{},"185":{},"186":{},"187":{},"188":{},"189":{},"190":{},"191":{},"192":{},"193":{},"194":{},"195":{},"196":{},"197":{},"198":{},"199":{},"200":{},"201":{},"202":{},"203":{},"204":{},"205":{},"206":{},"207":{},"208":{},"209":{},"210":{},"211":{},"212":{},"213":{},"214":{},"215":{},"216":{},"217":{},"218":{},"219":{},"220":{},"221":{},"222":{},"223":{},"224":{},"225":{},"226":{},"227":{},"228":{},"229":{},"230":{},"231":{},"232":{},"233":{},"234":{},"235":{},"236":{},"237":{},"238":{},"239":{},"240":{},"241":{},"242":{},"243":{},"244":{},"245":{},"246":{},"247":{},"248":{},"249":{},"250":{},"251":{},"252":{},"253":{},"254":{},"255":{},"256":{},"257":{},"258":{},"259":{},"260":{},"261":{},"262":{},"263":{},"264":{},"265":{},"266":{},"267":{},"268":{},"269":{},"270":{},"271":{},"272":{},"273":{},"274":{},"275":{},"276":{},"277":{},"278":{},"279":{},"280":{},"281":{},"282":{},"283":{},"284":{},"285":{},"286":{},"287":{},"288":{},"289":{},"290":{},"291":{},"292":{},"293":{},"294":{},"295":{},"296":{},"297":{},"298":{},"299":{},"300":{},"301":{},"302":{},"303":{},"304":{},"305":{},"306":{},"307":{},"308":{},"309":{},"310":{},"311":{},"312":{},"313":{},"314":{},"315":{},"316":{},"317":{},"318":{},"319":{},"320":{},"321":{},"322":{},"323":{},"324":{},"325":{},"326":{},"327":{},"328":{},"329":{},"330":{},"331":{},"332":{},"333":{},"334":{},"335":{},"336":{},"337":{},"338":{},"339":{},"340":{},"341":{},"342":{},"343":{},"344":{},"345":{},"346":{},"347":{},"348":{},"349":{},"350":{},"351":{},"352":{},"353":{},"354":{},"355":{},"356":{},"357":{},"358":{},"359":{},"360":{},"361":{},"362":{},"363":{},"364":{},"365":{},"366":{},"367":{},"368":{},"369":{},"370":{},"371":{},"372":{},"373":{},"374":{},"375":{},"376":{},"377":{},"378":{},"379":{},"380":{},"381":{},"382":{},"383":{},"384":{},"385":{},"386":{},"387":{},"388":{},"389":{},"390":{},"391":{},"392":{},"393":{},"394":{},"395":{},"396":{},"397":{},"398":{},"399":{},"400":{},"401":{},"402":{},"403":{},"404":{},"405":{},"406":{},"407":{},"408":{},"409":{},"410":{},"411":{},"412":{},"413":{},"414":{},"415":{},"416":{},"417":{},"418":{},"419":{},"420":{},"421":{},"422":{},"423":{},"424":{},"425":{},"426":{},"427":{},"428":{},"429":{},"430":{},"431":{},"432":{},"433":{},"434":{},"435":{},"436":{},"437":{},"438":{},"439":{},"440":{},"441":{},"442":{},"443":{},"444":{},"445":{},"446":{},"447":{},"448":{},"449":{},"450":{},"451":{},"452":{},"453":{},"454":{},"455":{},"456":{},"457":{},"458":{},"459":{},"460":{},"461":{},"462":{},"463":{},"464":{},"465":{},"466":{},"467":{},"468":{},"469":{},"470":{},"471":{},"472":{},"473":{},"474":{},"475":{},"476":{},"477":{},"478":{},"479":{},"480":{},"481":{},"482":{},"483":{},"484":{},"485":{},"486":{},"487":{},"488":{},"489":{},"490":{},"491":{},"492":{},"493":{},"494":{},"495":{},"496":{},"497":{},"498":{},"499":{},"500":{},"501":{},"502":{},"503":{},"504":{},"505":{},"506":{},"507":{},"508":{},"509":{},"510":{},"511":{},"512":{},"513":{},"514":{},"515":{},"516":{},"517":{},"518":{},"519":{},"520":{},"521":{},"522":{},"523":{},"524":{},"525":{},"526":{},"527":{},"528":{},"529":{},"530":{},"531":{},"532":{},"533":{},"534":{},"535":{},"536":{},"537":{},"538":{},"539":{},"540":{},"541":{},"542":{},"543":{},"544":{},"545":{},"546":{},"547":{},"548":{},"549":{},"550":{},"551":{},"552":{},"553":{},"554":{},"555":{},"556":{},"557":{},"558":{},"559":{},"560":{},"561":{},"562":{},"563":{},"564":{},"565":{},"566":{},"567":{},"568":{},"569":{},"570":{},"571":{},"572":{},"jQuery19005749572201166302":75,"sizzle-1454927918572":{"parentNode":["11 8",true]}},"selector":"option:selected"}

Filtering select

Hi, can you add filtering?
I imagine a simple input type/text that filters the options.
Really useful when option are more than 100. In general it is a cool feature.
I'm too busy to extend.

Thanks in advance.
V

Bug detected...

Hi,
I'd like to point you to a bug which i detected:
when you add the search option and type one character to filter ,Tab to right_all_Button and press space, the items on the left side will be disapeared and there is no chance to bring them back without reloading the page!!
Thx
RG

Two Destinations

Hi

Is it possible to have multiple destinations. I will have a main list of players that I want add to list 1 for starting 11 and add to list 2 with what is left for substitutions list.

Many Thanks
Scott

don't select all option when submit.

With my latest firefox, I do not get all option after submitting. I find your statement with attr. I think it should be prop

                // select all the options from left and right side
                // when submiting the parent form
                self.right.closest('form').on('submit', function(e) {
                    self.left.children().prop('selected', true);
                    self.right.children().prop('selected', true);
                    });



moveToRight, there is a copyToRight and clearFromRight

Hi, many thinks multiselect project.
There is a function in my mini project. Multiple right selects, just one left select. So when i clicked "copyToRight" button, the value of option from left select will copy to one of right selects. When i click the "clearFromRight" button, the value of option will disappear from right select.How about this feature?

Undo and redo

I would like to have undo and redo for this. If I have time I might look into it but for now this is just a feature request :)

I think this could be implemented by giving each option an id and creating a list of command-objects that contain a set of ids and a direction. When undo is called it simply looks at the direction and does the opposite with all options that are listed. Then the command-object is moved to a redo list. Every time the user clicks an action the redo list is emptied.

New Functionality

New functionality that will move option to the same place in left select that had before move to right select. It will be useful when ordering is diffrent then alphabetic, for example elemets are sorted on backend.

Dynamic Data

How to bind it with data which I get from Ajax Call

Search in IE11

Hi,
Thanks for give good plugin. Unfortunately we are facing issue with search i.e. its not working in IE11 where as it works fine in Chrome.

Thanks

package.json - browserify support

Hey,

First of all, your plugin looks great. Have u consider adding it to npm registery? I'm using a setup when the packages can be only installed via npm, so its kinda obstacle to me.

I will be fine without putting it into registery, all I need is package.json file in the repo, because since version 2.x of npm, packages can be installed from github :)

edit:

Apperantly that's not all. I've forked the repo, created simple package.json, installed via npm install pagenoare/multiselect. I've tried to use it within the code:

require('multiselect');

but building the project gives me error:

Error: Cannot find module 'multiselect' from PATH
Warning: Error running grunt-browserify. Use --force to continue.

Thanks!

keep render order with right side

right side don't have position value, so add it.

                if ( typeof self.callbacks.startUp == 'function' ) {
                    self.callbacks.startUp( self.left, self.right );

                    self.right.find('option').each(function(index, option) {
                        $(option).data('position', index);
                    });

                }

Ajax post doesnt receive selected values

Hello, not sure what is happening, but when i post some selected values via ajax, i cannot get them,
http://i.imgur.com/8VkDnII.png . I'm also using 3rd party ajax fraamework called Sijax, i tought it is this plugin issue, but then i tried with standard ajax, it is the same.

This is my init script:

$('#search').multiselect({ submitAllLeft: false, submitAllRight: true, search: { left: '<input type="text" name="q" class="form-control" placeholder="Search..." />', right: '<input type="text" name="q" class="form-control" placeholder="Search..." />', } });

This is ajax submit function:
$.ajax({ type: "POST", url: "/tools/testpost.php", data: $("#domainsgroup").serialize(), // serializes the form's elements. success: function (data) { alert(data); // show response from the php script. } });

And the output is in the screenshot. One time it was ok, when i did search, the selected all, and by doing this it worked fine, but if select one by one without searching, then something is not right. I was trying to do this on click submit, before requesting via ajax:

$("select#search_to option").each(function () { $(this).attr("selected", ""); //console.log($(this)); });

Not sure if i'm doing something wrong or what is happening. Also i tried simple form post, then it worked ok, but with ajax i have problems. Thanks!

do not submit option when using optgroup

You code

                // Select all the options from left and right side when submiting the parent form
                self.$right.closest('form').on('submit', function(e) {
                    self.$left.children().prop('selected', self.options.submitAllLeft);
                    self.$right.children().prop('selected', self.options.submitAllRight);
                });

children() only list all first level children.
When using tag optgroup, all tag option will be ignore...
My code as reference.

                self.$right.closest('form').on('submit', function(e) {
                    self.$left.children().each(function(index, option) {
                        var $option = $(option);
                        if ($option.is('optgroup')) {
                            $option.children().prop('selected', self.options.submitAllLeft);
                        } else {
                            $option.prop('selected', self.options.submitAllLeft);
                        }
                    });
                    self.$right.children().each(function(index, option) {
                        var $option = $(option);
                        if ($option.is('optgroup')) {
                            $option.children().prop('selected', self.options.submitAllLeft);
                        } else {
                            $option.prop('selected', self.options.submitAllLeft);
                        }
                    });
                });

double-click not working in new IE (11 and 12)

There is a hack in the code to support the double-click:

                // dblclick support for IE
                if ( navigator.userAgent.match(/MSIE/i) ) {
                    self.left.dblclick(function(e){
                        actions.rightSelected.trigger('click');
                    });

                    self.right.dblclick(function(e){
                        actions.leftSelected.trigger('click');
                    });
                }

The useragent string got changed in the newer versions of IE. The code needs to be enhanced. Check this out: http://stackoverflow.com/questions/19999388/jquery-check-if-user-is-using-ie

The proposed enhancement is:

                // dblclick support for IE
                if ( navigator.userAgent.match(/MSIE/i)  || navigator.userAgent.indexOf('Trident/') > 0 || navigator.userAgent.indexOf('Edge/') > 0) {

Search is case sensitive

Due to the use of the ":contains" selector the search is case sensitive. Your plugin is very useful but I do need case insensitive search. Would it be possible to provide a way to override the search?

Doesn't work with jQuery 1.7.0

The following error is thrown when using with jQuery 1.7.0:

TypeError: $.expr.createPseudo is not a function

A google search lead me to this SO, which does solve the issue, but I'm not sure if it would effect some functions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.