Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is Working demo. <a href="http://jsfiddle.net/UMeHU/3/" rel="nofollow">Jsfiddle Demo</a></p> <p><strong>HTML</strong></p> <pre><code>&lt;ul class='fetchedfromdb' id="da1"&gt; //parent element &lt;li id="1"&gt;Data1&lt;/li&gt; &lt;br /&gt; &lt;li id="2"&gt;Data2&lt;/li&gt; &lt;br /&gt; &lt;li id="3"&gt;Data3&lt;/li&gt; &lt;br /&gt; &lt;div style="background-color: #c3c3c3; height:100px"&gt; &lt;ol class="sortintodb" id="e201"&gt; &lt;li class="placeholder" id="9"&gt;Drop here&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/ul&gt;//ends &lt;hr /&gt; &lt;h2&gt;e202&lt;/h2&gt; &lt;ul class='fetchedfromdb'&gt; &lt;li id="5"&gt;Data1&lt;/li&gt; &lt;br /&gt; &lt;li id="6"&gt;Data2&lt;/li&gt; &lt;br /&gt; &lt;li id="7"&gt;Data4&lt;/li&gt; &lt;br /&gt; &lt;div style="background-color: #c3c3c3; height:100px"&gt; &lt;ol class="sortintodb" id="e202"&gt; &lt;li class="placeholder" id="8"&gt;Drop here&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/ul&gt; &lt;hr /&gt; </code></pre> <p><strong>Script</strong></p> <pre><code>$(".fetchedfromdb li").draggable({ containment: 'parent', helper: "clone", connectToSortable: '.sortable', }); $(".sortintodb").droppable({ activeClass: "ui-state-default", hoverClass: "ui-state-hover", accept: ":not(.ui-sortable-helper)", drop: function(event, ui) { var self = $(this); //if you don't want same "data" in placeholder more than once self.find(".sortintodb").remove(); var dropId = ui.draggable.attr('id'); if (self.find("[id=" + dropId + "]").length) return; $("&lt;li&gt;&lt;/li&gt;", { "text": ui.draggable.text(), "id": dropId }).appendTo(this); }, }); $('.sortintodb').sortable({ placeholder: "ui-state-highlight", }); </code></pre>
    singulars
    1. This table or related slice is empty.
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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