Jquery ui-sortable - unable to drop tr in empty tbody

前端 未结 9 737
后悔当初
后悔当初 2021-02-01 19:43

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

9条回答
  •  情书的邮戳
    2021-02-01 20:00

    i use:

    $(document).ready(function(){
          $( "#sortable1 tbody, #sortable2 tbody" ).sortable({
          connectWith: ".connectedSortable",
          remove: function(event, ui){ if($(this).html().replace(/^\s+/, "") == '') { $(this).html(' '); }},
          update: function( event, ui ) {$(this).find('.tmp_tr').remove();},
        }).disableSelection();
    

    });

提交回复
热议问题