对嵌套在另一个 table 中的 table 进行排序(使用 Tablesorter)
Sorting a table that's nested in another table (with Tablesorter)
我有一个现有的 table,它使用 Tablesorter jQuery 插件进行排序,效果很好。
我最近添加了一些功能,因此当您单击以展开 table 的其中一行时,它:
- 添加新行(将 colspan 设置为跨越所有列)
- 将新的 HTML 加载到新创建的行中,其中包含 table 和
唯一的 id 和一个单独的调用来使用 tablesorter 作为 table with
那个ID
同样,一切都很好。但是,虽然 tablesorter 在整个父级 table 上运行良好,但它根本不会在内部 table.
上加载
我怀疑我的整个方法可能有问题,因为我已经尝试过其他 table 排序插件(如 Stupid Table Plugin)并且其中 none 有效,要么。
我做错了什么吗?还是我需要通过 jsFiddle 深入了解共享细节?
原始版本的 tablesorter (v2.0.5),不适用于嵌套表格 - demo。
$(function() {
$('table').tablesorter();
});
看看我的 fork of tablesorter which better deals with nested tables and nested themes - demo。
$(function() {
$('table').tablesorter({
theme: 'blue'
});
});
我有一个现有的 table,它使用 Tablesorter jQuery 插件进行排序,效果很好。
我最近添加了一些功能,因此当您单击以展开 table 的其中一行时,它:
- 添加新行(将 colspan 设置为跨越所有列)
- 将新的 HTML 加载到新创建的行中,其中包含 table 和 唯一的 id 和一个单独的调用来使用 tablesorter 作为 table with 那个ID
同样,一切都很好。但是,虽然 tablesorter 在整个父级 table 上运行良好,但它根本不会在内部 table.
上加载我怀疑我的整个方法可能有问题,因为我已经尝试过其他 table 排序插件(如 Stupid Table Plugin)并且其中 none 有效,要么。
我做错了什么吗?还是我需要通过 jsFiddle 深入了解共享细节?
原始版本的 tablesorter (v2.0.5),不适用于嵌套表格 - demo。
$(function() {
$('table').tablesorter();
});
看看我的 fork of tablesorter which better deals with nested tables and nested themes - demo。
$(function() {
$('table').tablesorter({
theme: 'blue'
});
});