Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery UI - Draggable + Droppable entire list
    primarykey
    data
    text
    <p>I'm trying to create a Draggable + Droppable list, and so far i've managed to make it work with single items of the list.</p> <p>But i want to be able to drag and drop an entire list. Is that possible?</p> <p>What i have is a nested accordian with a few lists and a droppable div to receive the items:</p> <pre><code>&lt;div&gt; &lt;div id="faqs-container" style="float: left; width: 250px" class="accordian"&gt; &lt;h3&gt;&lt;a href="#"&gt;One&lt;/a&gt;&lt;/h3&gt; &lt;div class="accordian"&gt; &lt;h3&gt;&lt;a class=href="#"&gt;A&lt;/a&gt;&lt;/h3&gt; &lt;div&gt; &lt;ul&gt; &lt;li&gt;list1&lt;/li&gt; &lt;li&gt;list2&lt;/li&gt; &lt;li&gt;list3&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;h3&gt;&lt;a href="#"&gt;B&lt;/a&gt;&lt;/h3&gt; &lt;div&gt; &lt;ul&gt; &lt;li&gt;list4&lt;/li&gt; &lt;li&gt;list5&lt;/li&gt; &lt;li&gt;list6&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style="float: right; width: 200px"&gt; &lt;div class="grupoFinal"&gt; &lt;div class="ui-widget-content"&gt; &lt;ol&gt; &lt;li class="placeholder"&gt;Drop here!&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And with jquery i make it work:</p> <pre><code>$("div.accordian").accordion({ autoHeight: false, collapsible: true, active: false, }); $("div.accordian li").draggable({ //appendTo: "body", helper: "clone" }); $(".grupoFinal ol").droppable({ drop: function (event, ui) { $(this).find(".placeholder").remove(); $("&lt;li&gt;&lt;/li&gt;").text(ui.draggable.text()).appendTo(this); } }); </code></pre> <p>Here i have <a href="http://jsfiddle.net/pboga/XD3d9/" rel="nofollow">a working demo</a>.</p> <p>So, what i want do do is to drag an entire list, for example, list A, and drop all the item inside on the droppable div. Is it possible?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload