获取jQuery tablesorter以使用隐藏/分组表行 [英] Getting jQuery tablesorter to work with hidden/grouped table rows

查看:120
本文介绍了获取jQuery tablesorter以使用隐藏/分组表行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有可扩展和可折叠记录的经典表格,如果展开则显示多个子记录(作为同一父表中的新记录,而不是一些子div /子表)。我也在使用tablesorter并且非常喜欢它。

I have the classical table with expandable and collapsible records that if expanded show several subrecords (as new records in the same parent table, not some child div/child table). I am also using tablesorter and absolutely love it.

问题是tablesorter没有在父记录旁边保留扩展子记录。它将它们分类为顶级。因此,每当表按列排序时,子行最终会遍布整个地方而不是我想要的位置。

The problem is that tablesorter isn't keeping expanded child records next to the parent records. It sorts them as if they were top level. So each time the table gets sorted by a column the child rows end up all over the place and not where I want them.

有没有人知道对tablesorter的良好扩展或者特定的配置,即使在排序之后,tablesorter还是可以将子行与父行组合在一起?或者我是否必须放弃tableorter以支持其他API或者开始编写我自己的小部件的丑陋过程?我应该避免使用基于CSS的方法隐藏表的各行来表示折叠行吗?

Does anyone know of a good extension to tablesorter or specific configuration that enables tablesorter to keep child rows grouped together with the parent row even after sorting? Or do I have to give up tablesorter in favor of some other API or start the ugly process of writing my own widget? Should I avoid the css-based approach of hiding individual rows of the table to represent collapse rows?

推荐答案

如果你想保留的tablesorter,存在其中我在这里用于该目的的 可用一个模

If you want to keep tablesorter, there is a mod which I have used for this purpose available here

在包含它之后,你让你的第二个(可扩展子)行拥有expand-child类,而tablesorter将知道保持该行与其父级(前一行)配对。

After including it, you make your second (expandable child) row have the class "expand-child", and tablesorter will know to keep the row paired with its parent (preceding row).

这篇关于获取jQuery tablesorter以使用隐藏/分组表行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆