Note that there are some explanatory texts on larger screens.

plurals
  1. POUser jQuery to drag a DIV and drop in a TD ... and have the DIV "snap" into place
    primarykey
    data
    text
    <p>I am finishing up a rewrite of task management system, and am in the process of adding drag and drop capabilities.</p> <p><img src="https://lh3.ggpht.com/_MwlyfvVOvjY/Sv2SFbN0IPI/AAAAAAAAAJA/BpxTgdJbZ6U/s912/Queue.png" alt="alt text"></p> <p>I want the user to be able to drag a task DIV from one column (TD) and drop it in another column (TD). I have this working correctly, save for some minor formatting issues. I have the TD with a class called droppable that accepts draggable classes. What I would like to happen is actually remove the task DIV from the current TD and append it to the dropped on TD. </p> <p>Here is my script:</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { $(".draggable").draggable({ cursor: 'move', cancel: 'a', revert: 'invalid', snap: 'true' }); }); $(function() { $(".droppable").droppable({ accept: '.draggable', hoverClass: 'droppable-hover', drop: function(event, ui) { } }); }); &lt;/script&gt; </code></pre> <p>Here is my Html:</p> <pre><code>&lt;h3&gt; My Queue&lt;/h3&gt; &lt;table style="width: 100%;" class="queue"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td style="width: 14%; vertical-align:bottom ;" class="droppable" id="StagePG"&gt; &lt;/td&gt; &lt;td style="width: 14%; vertical-align:bottom ;" class="droppable" id="StageRY"&gt; &lt;/td&gt; &lt;td style="width: 14%; vertical-align:bottom ;" class="droppable" id="StagePR"&gt; &lt;div class="queue-item draggable" title="Task description goes here."&gt; &lt;em&gt;Customer&lt;/em&gt; &lt;strong&gt;Project&lt;/strong&gt; &lt;h4&gt;&lt;a href="/Sauron/Task/Details/100001"&gt;100001&lt;/a&gt;&lt;/h4&gt; &lt;/div&gt; &lt;div class="queue-item draggable" title="Task description goes here."&gt; &lt;em&gt;Customer&lt;/em&gt; &lt;strong&gt;Project&lt;/strong&gt; &lt;h4&gt;&lt;a href="/Sauron/Task/Details/100002"&gt;100002&lt;/a&gt;&lt;/h4&gt; &lt;/div&gt; &lt;/td&gt; &lt;td style="width: 14%; vertical-align:bottom ;" class="droppable" id="StageRT"&gt; &lt;/td&gt; &lt;td style="width: 14%; vertical-align:bottom ;" class="droppable" id="StageTE"&gt; &lt;/td&gt; &lt;td style="width: 14%; vertical-align:bottom ;" class="droppable" id="StageRL"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;tfoot&gt; &lt;tr&gt; &lt;td style="width: 14%; text-align: center;"&gt; Pending (0) &lt;/td&gt; &lt;td style="width: 14%; text-align: center;"&gt; Ready (0) &lt;/td&gt; &lt;td style="width: 14%; text-align: center;"&gt; In Progress (2) &lt;/td&gt; &lt;td style="width: 14%; text-align: center;"&gt; Ready for Testing (0) &lt;/td&gt; &lt;td style="width: 14%; text-align: center;"&gt; Testing (0) &lt;/td&gt; &lt;td style="width: 14%; text-align: center;"&gt; Ready for Release (0) &lt;/td&gt; &lt;/tr&gt; &lt;/tfoot&gt; &lt;/table&gt; </code></pre> <p>Struggling with the drop event and how to implement this. Any help is appreciated!</p>
    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.
 

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