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

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

    I know this question has been marked as "answered" but I also wanted to add another way to approach this.

    What I do is check if the list empty, if so, create a new row element and inject it into the tbody. I put a message like "No more items" in the td.

    Once an item is dropped into the "empty" list, the empty message will be destroyed.

    I use Mootools hence the lack of example code.

提交回复
热议问题