Some time ago, I needed to take a list of items and select from them a subset, put that subset of items into a particular order, and then submit them to the server. A good example would be when you have a list of posts and you need to choose which ones (and in which order) you want to print them. Drag and Drop is a breeze with jQuery and jQuery UI.
Here is a video of it in action:
This was very easy to do with just a small amount of code. Here is the setup:
…and the code:
Once you’ve selected your items, it’s just a matter of POSTing the #postOrder input element to your server with a list of the IDs and their corresponding order.
Pingback: jQuery Example: Inserting text with drag n’ drop « SKFox.com
Its good example for drag and drop list items. It helped me very much in my project. Thanks a lot
How can i disable reordering in one listbox. for example in i don’t need reordering option in first listbox. ie, sortable1. Can anyone help me?. Thanks in advance
It looks and works great in Chrome, but it doesn’t work on an iPad with Safari. You can’t select the items to drag.
for iOs iPad etc… it’ll be great to add that library, but unfortunatly It didn’t work here : https://github.com/furf/jquery-ui-touch-punch