I have two connected tbody elements allowing me to drag rows between two tables. Everything works fine until all rows are removed from either table.
When all rows have
Here's how I solved the issue with being unable to drop a tr in an empty tbody:
$(function() {
var sort1 = $('#sort1 tbody');
var sort2 = $('#sort2 tbody');
sizeCheck(sort1);
sizeCheck(sort2);
//Start the jQuery Sortable for Active and Fresh Promo Tables
$("#sort1 tbody, #sort2 tbody").sortable({
items: ">*:not(.sort-disabled)",
deactivate: function(e, ui) {
sizeCheck(sort1);
sizeCheck(sort2);
},
//Connect tables to pass data
connectWith: ".contentTable tbody"
}).disableSelection();
});
//Prevent empty tbody from not allowing items dragged into it
function sizeCheck(item){
if($(item).height() == 0){
$(item).append(' ');
}
}