Some time ago I needed simple sortable listbox (html select element). The first thing I do in such cases is check existing jQuery plugins. However surprisingly I didn’t find suitable implementation. So I wrote it by myself and then wrap it as jQuery plugin (it is published on github also: https://github.com/sadomovalex/jquery.sortablelist. Please use it as primary source, because code may be changed in future):
I decided to share it – may be it will be useful for someone else. Currently it is released with version 0.1 and contains mostly features which I needed in my project, however it also contains few options which can be used for customization:
Width of the div which will be added next to the html select element. Default value is 20.
|up||Text (or html content) for up arrow. Default value is "⇑" (
Text (or html content) for down arrow. Default value is "⇓" (
|width||If width of html select element can't be determined, this parameter will be used for width of wrapping div. Default value is 200.|
If height of html select element can't be determined, this parameter will be used for height of wrapping div. Default value is 100.
Living demo can be checked here: http://camlex-online.org/demo/jquery-sortable-list-plugin-demo.html. If you will find bugs or will need new features, you may leave comments here or on github.