Reputation: 15861
As I am trying to work on sorting some data using Jquery, I thought I would use drag and drop. Later, I visited the jQueryui site. They have 'drag and drop' as well as sortable functionality.
Now I implemented 'drag and drop' functionality to sort the HTML Table Row with saving their position in DB.
Now I am getting confused, though:
Upvotes: 2
Views: 1900
Reputation: 2656
Sortable works with tables too, see this jsFiddle
Concerning differences between Sortable and Drag&Drop, they are just answering to two differents needs :
With sortable, you are searching for a logical behaviour with sorted items. With drap&drop your are searching for interaction between items.
For example, organizing your desktop icons is like sortable (moving an icon will move others all around to reorganize them). If you take a folder to put it into another one, it's like draggable/droppable (taking a folder and droppping it over another one will not reorganize it but trigger an action which will be to move the folder inside the other).
Take a look at jQuery UI documentation for Sortable and Draggable/Droppable.
Hope this will help you.
Upvotes: 6