Madara's Ghost
Madara's Ghost

Reputation: 175038

jQuery plugin for table cell replacement

I need a jQuery plugin that will take an HTML table, and will allow the replacement of cells in between each other, via drag n drop. Example:

[1][2][3]
[4][5][6]
[7][8][9]

When I drag 1 onto 9, it should replace them like so:

[9][2][3]
[4][5][6]
[7][8][1]

ideally with an optional callback function (to update a remote page with ajax).

Thanks in advance.

Upvotes: 0

Views: 141

Answers (3)

VIK
VIK

Reputation: 689

Look at this: http://www.redips.net/javascript/drag-and-drop-table-content/

Check the "Switch content option" below the table.

Upvotes: 2

Madara's Ghost
Madara's Ghost

Reputation: 175038

I've got it! http://jsfiddle.net/8dRZz/

In this example, it will stay "loading" forever, easily understandable since the handler in not there, so no AJAX success call.

Upvotes: 1

citizen conn
citizen conn

Reputation: 15390

If not a plugin, then at least how to get to it and even try to write it myself.

Using jQuery UI you can create draggable elements. You can also create droppable elements.

Try messing around with those demos using a table and table cells and see how far you can get by yourself. If you hit a dead-end, come back and someone may be able to help you out once you have some code!

Upvotes: 1

Related Questions