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

前端 未结 9 532
后悔当初
后悔当初 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 19:49

    js

    $(".sortable").sortable({
        items: 'tbody > tr',
        connectWith: ".sortable"
    });
    

    css

    .sortable {
        background-color: silver;    
        height: 10px;
    }
    
    .sortable td { background-color: white; }
    

    html

    More details and even a better code at https://devstuffs.wordpress.com/2015/07/31/jquery-ui-sortable-with-connected-tables-and-empty-rows/

提交回复
热议问题