Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery Plugin - Sort nested lists between two lists

So, I need to drag and drop between two nested lists. A sort of combination of this: http://jqueryui.com/demos/sortable/#connect-lists

and this: http://mjsarfatti.com/sandbox/nestedSortable/

Is there something that already does this, or should I try to use these at the same time, somehow?

like image 982
Colin DeClue Avatar asked Apr 20 '12 15:04

Colin DeClue


2 Answers

You can just use jQuery UI's connectWith option on the nestedSortable plugin, since the latter is just an extension of the default jQuery UI sortable.

Demo: http://jsfiddle.net/jhogervorst/Ge7eK/9/

JavaScript code:

$('ol.sortable').nestedSortable({
    /* … Options for nestedSortable … */
    connectWith: '.sortable'
});​
like image 51
Jonathan Avatar answered Oct 25 '22 10:10

Jonathan


The jquery ui solution can handle nested lists: http://jsfiddle.net/wyV7f/3/

If you need anything more than that perhaps you can hack it in?

like image 36
Lowkase Avatar answered Oct 25 '22 11:10

Lowkase