views:

151

answers:

1

Currently I have a table similar to below:

<table id="tbl">
    <thead>
        <tr><th>Example Title</th><th>Title2</th></tr>
    </thead>
    <tbody id="tblbdy">
        <tr><td>data1</td><td>data2</td></tr>
    </tbody>
</table>

I am using script.aculo.us currently with the code:

Sortable.create('tblbdy', {tag: 'tr', ghosting: false, constraint: 'vertical', onUpdate: sortparts});

This basically makes a very simple you effect that you click on the row, drag it up/down, it inserts it into the new sport and calls the function "sortparts", it works great; However on my curent project I am phasing out script.aculo.us to cut down on the javascript footprint and to switch to YUI for all the visual stuff (and this is the last bit).

How would I achieve a similar result with YUI?

I have tried to just new YAHOO.util.DD(row) on each row but nothing happens at all...

edit I have found this: http://normankosmal.com/wordpress/?p=25 which works however if you have any textboxes in your table you can no longer edit them.

A: 

Have you looked at this code example.

http://developer.yahoo.com/yui/examples/datatable/dt_ddrows.html

Zoidberg
Yes; that works for a YUI datatable (which i am not using for this table) but does not work for a regular table.
Mike Valstar
Ahh, there is probably a lot more around the Drag and Drop that you need to address then. The datatable supports the moving of the row, the Drag and drop just gives the effect of grabbing something and moving around. The target will need to support the drop.
Zoidberg