I've got a ...very... nested set of tables.
Here's my DOM:
<table id="sortable">
<thead>...</thead>
<tbody>
<tr class="draggable_item">
<td>
<table>
<thead class="show_this_while_dragging">...</thead>
<tbody class="hide_this_while_dragging">
<tr>
<td>...</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
Each tr in table#sortable is draggable. When it's being dragged, I want to hide the tbody in the table inside each tr.draggable_item.
Here's how I initialize my sortable:
$( selector ).sortable({
helper: fixHelper
});
$( selector ).sortable( "option", "start", function(event, ui) { start_callback(selector) } );
function start_callback(selector)
{
$(selector + " table tbody").hide();
}
This works almost as expected. Each tbody disappears, even the one that is being dragged. But there's extra space where the tbody was in the currently dragged item.
I am not sure what's causing it, or how to remove it. The height of the tr.draggable_item that is being dragged is locked as soon as I start dragging the item.
detaching the elements as opposed tohideing them doesn't seem to have an effect. I believe the problem is with the start event. I think I want something like a beforeStart event.