# Drag and drop table row problem

**URL:** <https://www.ruby-forum.com/t/drag-and-drop-table-row-problem/177723>\
**Category:** Rails\
**Created:** [October 22, 2009, 5:41pm UTC](https://www.ruby-forum.com/t/drag-and-drop-table-row-problem/177723 "2009-10-22T17:41:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [October 22, 2009, 5:41pm UTC](https://www.ruby-forum.com/t/drag-and-drop-table-row-problem/177723/1 "2009-10-22T17:41:50Z")

</div>

Hello all,  
I’m trying my first drag and drop project. Dragging a table row from  
one table to another.

First, get table 1 row to be draggable.  
I looked over several examples of Prototype/Scriptaculous of drag/drop  
and thought I was doing right.  
My problem is after setting it up, no dragging.

## Table 1

```
    <% @imports.each do |import| %>
    <% import_id = "import_#{import.id}" %>
    <tr id="<%= import_id %>" class="draggable_item"

```

style=“cursor:move;”\>

  
  
  
  
  
  
\<%= draggable\_element(import\_id, :revert =\> true ) %\>  
\<% end %\>  

| IRB File |
| --- |
| IRB ID | Title | Pi full name | Action |
| --- | --- | --- | --- |
| \<%=h import.irb\_id %\> | \<%=h truncate( import.title, :length =\> 30 ) %\> | \<%=h import.pi\_full\_name %\> | \<%= link\_to\_function(‘View’,  
‘showDialog(’+import.id.to\_s+’)’ ) %\> | \<%= link\_to\_remote “Find Matches”, :update =\>  
“search\_results”, :url =\> {:controller =\> ‘projects’, :action =\>  
‘search’, :id =\> import.irb\_id } %\> |

I’m not sure what’s wrong.

Thank you for any help.

JohnM

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [October 22, 2009, 5:45pm UTC](https://www.ruby-forum.com/t/drag-and-drop-table-row-problem/177723/2 "2009-10-22T17:45:57Z")

</div>

Oh, another thing.

When I click on the row, the all the text in the row does fade (similar  
to the drag/drop examples). It seems to me that I’m almost there.

Thank you.

John

John M. wrote:

> Hello all,  
> I’m trying my first drag and drop project. Dragging a table row from  
> one table to another.
> 
> First, get table 1 row to be draggable.  
> I looked over several examples of Prototype/Scriptaculous of drag/drop  
> and thought I was doing right.  
> My problem is after setting it up, no dragging.
> 
> ## Table 1
> 
> ```
> <% @imports.each do |import| %>
> <% import_id = "import_#{import.id}" %>
> <tr id="<%= import_id %>" class="draggable_item"
> 
> ```
> 
> style=“cursor:move;”\>
> 
>   
>   
>   
>   
>   
>   
> \<%= draggable\_element(import\_id, :revert =\> true ) %\>  
> \<% end %\>  
> 
> | IRB File |
> | --- |
> | IRB ID | Title | Pi full name | Action |
> | --- | --- | --- | --- |
> | \<%=h import.irb\_id %\> | \<%=h truncate( import.title, :length =\> 30 ) %\> | \<%=h import.pi\_full\_name %\> | \<%= link\_to\_function(‘View’,  
> ‘showDialog(’+import.id.to\_s+’)’ ) %\> | \<%= link\_to\_remote “Find Matches”, :update =\>  
> “search\_results”, :url =\> {:controller =\> ‘projects’, :action =\>  
> ‘search’, :id =\> import.irb\_id } %\> |
> 
> I’m not sure what’s wrong.
> 
> Thank you for any help.
> 
> JohnM
