我正在使用可排序的jQuery UI(工作正常)。我想使标题和最后一行固定(不可移动)。jQuery UI可排序固定行
jQuery UI文档指出这可以使用项目的选择器来完成,但是我对语法感到不知所措。
下面是相关代码:
<script type="text/javascript">
$(function() {
$("#response_options tbody.content").sortable();
$("#response_options tbody.content").disableSelection();
});
</script>
<table id="response_options" class="data-table">
<tbody class="content">
<tr>
<th>Links</th><th>Response</th>
</tr>
<tr class="sortable-row">
<td>Edit</td>
<td>Item 1</td>
</tr>
<tr class="sortable-row">
<td>Edit</td>
<td>Item 2</td>
</tr>
<tr class="sortable-row">
<td>Edit</td>
<td>Item 3</td>
</tr>
<tr class="sortable-row">
<td>Edit</td>
<td>Item 4</td>
</tr>
<tr class="sortable-row">
<td>Edit</td>
<td>Item 5</td>
</tr>
<tr>
<td>Edit</td>
<td>Item 1</td>
</tr>
</tbody>
</table>
的选择走了进去.sortable(...):
$("#response_options tbody.content").sortable();
为
$("#response_options tbody.content").sortable(items: ???);
,它应该是可能的只选择class =“sortable-row”的项目;但是再一次,我对语法感到不知所措。
我喜欢这个更多! :) – Basti 2012-03-22 13:53:19