我目前使用以下方法来告诉我的表不使用jQuery tablesorter插件排序某些列:的jQuery的tablesorter如果有不列进行排序类
$(".uiGridContent table").tablesorter({
sortList: [[1, 0]],
headers: {
0: { sorter: false },
5: { sorter: false },
6: { sorter: false }
}
});
的问题是,在我的应用程序,用户可以添加和删除列,所以订单可以改变,所以我目前的代码不是一个可行的解决方案。如果我在列上放置课程,我不想排序<col class="nosort" />
我怎么能这样做,所以它不排序这些列?
因为我使用<col />
我曾尝试以下:
$filter_ignore = $("col.nosort").closest("th").index();
$(".uiGridContent table").tablesorter({
sortList: [[1, 0]],
headers: {
$filter_ignore: {
sorter: false
}
}
});
但不工作:/
我想我需要某种形式的循环,找到所有的日与一列为他们与clase!这里是我的表的例子:
<table>
<colgroup>
<col class="nosort" />
<col />
</colgroup>
<thead>
<tr>
<th scope="col">a</th>
<th scope="col">b</th>
</tr>
</thead>
<tbody>
<tr>
<td scope="col">a</td>
<td scope="col">b</td>
</tr>
</tbody>
</table>
感谢
退房http://stackoverflow.com/questions/5672993/how-to-ignore-th-with-specific-class-name-in-tablesorter – realshadow
嗨,试过(见OP),但不起作用:/ – Cameron