我想创建一个表,该表在单个列中具有拖放可排序项目,但单个列中项目的移动不会影响其他列中项目的位置。
下面的代码对整行(左列和右列)进行排序,而不仅仅是右列。JQuery UI 文档中似乎没有解决它。有没有人尝试过这样做?
<script>
$(function() {
$("table tbody").sortable({
handle: '.handle'
}).disableSelection();
});
</script>
<table>
<tbody id="sortable">
<tr>
<td>1 - Column Item I Want to Stay In Place</td>
<td class="handle">Item 1 - The Part That Should Be Draggable/Sortable</td>
</tr>
<tr>
<td>2 - Column Item I Want to Stay In Place</td>
<td>Item 2 - The Part That Should Be Draggable/Sortable</td>
</tr>
<tr>
<td>3 - Column Item I Want to Stay In Place</td>
<td class= "handle">Item 3 - The Part That Should Be Draggable/Sortable</td>
</tr>
</table>