jQuery UI sortable on select options
Workind demo for select options sorting using multiselect js widget: http://jsfiddle.net/QRv6d/9/
good link: https://github.com/yanickrochon/jquery.uix.multiselect http://quasipartikel.at/2009/05/10/jqueryui-multiselect/ & http://quasipartikel.at/multiselect/
please note: I cannot find any simple sortable implementation of sortable() with select boxes
hence using this multiselect plugin and as you can see in demo it does work :)
you can use it according to your need. full HTML is in js fiddle.
Hope this helps,
script source
<script type="text/javascript" src="http://quasipartikel.at/multiselect/js/ui.multiselect.js"></script>
code
$(function(){
$(".multiselect").multiselect();
});
HTML
<select id="countries" class="multiselect" multiple="multiple">
<option value="AUT" selected="selected">Austria</option>
<option value="DEU" selected="selected">Germany</option>
<option value="NLD" selected="selected">Netherlands</option>
<option value="USA" selected="selected">United States</option>
</select>
Image
user1038814
Updated on June 28, 2022Comments
-
user1038814 almost 2 years
I'm trying to get jQuery UI default sortable to work on options in a select multi list box but can't seem to get it working. Can this work with a select option? I've only seen examples with
<li>
everywhere.Here's my JavaScript:
$(function() { $( "#secondSelectms2side__dx" ).sortable(); $( "#secondSelectms2side__dx" ).disableSelection(); });
And the HTML:
<select title="" name="secondSelectms2side__dx" id="secondSelectms2side__dx" size="8" multiple="multiple"> <option value="4">asdsdsds</option> <option value="10">bsdsdsdsd</option> <option value="2">csdsdsds</option> </select>
My code is on jsFiddle:
-
user1038814 almost 12 yearsThanks for that. I'll try and adapt that. Cheers
-
Howie over 8 yearsDead links @Tats_innit
-
Tats_innit over 8 yearsShot bro @Howie . I have updated the link bruv, Will look into the demo, but you can actually see the git repo to check it out.