【发布时间】:2012-03-15 17:21:17
【问题描述】:
我有一张桌子:
<table class="products">
<thead>...</thead>
<tfoot>...</tfoot>
<tbody id="the-list">
<tr id="order-0">
<th scope="row" class="check-column">stuff</th>
<td class="title column-title">stuff</td>
<td class="order column-order">stuff</td>
<td class="display column-display">stuff</td>
<td class="action column-action">stuff</td>
</tr>
<tr id="order-1">
<th scope="row" class="check-column">stuff</th>
<td class="title column-title">stuff</td>
<td class="order column-order">stuff</td>
<td class="display column-display">stuff</td>
<td class="action column-action">stuff</td>
</tr>
<tr id="order-2">
<th scope="row" class="check-column">stuff</th>
<td class="title column-title">stuff</td>
<td class="order column-order">stuff</td>
<td class="display column-display">stuff</td>
<td class="action column-action">stuff</td>
</tr>
</tbody>
</table>
当我使用“可排序”和默认所有内容时,一切都很好:
jQuery('table.products tbody').sortable();
现在当我尝试序列化时,所有可排序的功能都消失了,表格是静态的(虽然没有错误...)
jQuery('table.products tbody').sortable('serialize');
我做错了什么?
【问题讨论】:
-
你两个都做吗?先用
.sortable()初始化,然后用.sortable('serialize')调用方法?如果你只做第二个,插件将不会初始化,实际上什么也不会发生。 -
现在我只是觉得很傻。我现在不能接受评论作为答案吗?
-
不,你不能,我已经发布了答案;-)
-
否;但你可以投票给月球,我也可以!
标签: jquery jquery-ui jquery-ui-sortable