In JQuery UI, I have a draggable, It have an option connectToSortable as below:
$("#social li").draggable({
connectToSortable: '#form_builder_sortable',
helper:'clone',
revert:true
});
'#form_builder_sortable' is a sortable as below:
$("#form_builder_sortable").sortable();
I want 1 draggable list connect to multiple sortable list, such as:
$("#social li").draggable(
{
connectToSortable: '#form_builder_sortable, #form_builder_sortable_sample',
helper:'clone',
revert:true
});
Have you got any solutions or suggestion to do as my requirement? Thanks a lot
The
connectToSortable
option accepts a selector and a selector can specify any number of lists.Please see following example:
Draggable list
Mulitiple list
I gave them same class
class="sortable"
because I want drag draggable list to both of them. Finally I can use code below for drag it:Online demo (fiddle)