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

前端 未结 9 552
后悔当初
后悔当初 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:09

    I have the same question, and managed to half solve it by doing this:

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

    This allows me to move rows on to an empty table, and it looks fine, but the element is inserted after the tbody instead of inside it. I think Danny Robert's answer will work for me but I'd be interested in seeing a non hack solution.

提交回复
热议问题