合并两行的表排序器
具有组合行的 jQuery 表排序器
每第二行都包含第一行的详细数据。默认情况下,它是用 CSS 隐藏的,但我可以用 jQuery 将其滑动打开。
我想要实现的目标:类似于此 jQuery 插件的表排序: http://tablesorter.com/docs/
问题:插件应该将所有成对的行“粘合在一起”,并将它们移动在一起。应仅对第一行(.row-vm)的数据进行排序,而忽略第二行(.row-details)的内容。
有支持这个的 jQuery 插件吗?
<tr class="row-vm">
<td>...</td>
<td>...</td>
...
</tr>
<tr class="row-details">
<td colspan="6">
Description data
</td>
</tr>
<tr class="row-vm">
<td>...</td>
<td>...</td>
...
</tr>
<tr class="row-details">
<td colspan="6">
Description data
</td>
</tr>
jQuery table sorter with combined rows
Every second row contains detail data for the first row. By default, it is hidden with CSS, but I can slide it open with jQuery.
What I would like to achieve: Table sorting similar to this jQuery plugin: http://tablesorter.com/docs/
The problem: The plugin should "glue together" all pair rows, and move them together. The sorting should be done only with the data of the first row (.row-vm), while ignoring the content of the second row (.row-details).
Is there a jQuery plugin that supports this?
<tr class="row-vm">
<td>...</td>
<td>...</td>
...
</tr>
<tr class="row-details">
<td colspan="6">
Description data
</td>
</tr>
<tr class="row-vm">
<td>...</td>
<td>...</td>
...
</tr>
<tr class="row-details">
<td colspan="6">
Description data
</td>
</tr>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
所以我不确定这有多少记录,但我找到了我认为您在表对象中寻找的内容。
看看 这个 fiddle
看起来你可以添加一个
expand-child
类。或者你可以传入你自己的类名So i'm not sure how well documented this was but i found what i think you are looking for in the table object.
Check out this fiddle
It looks like you can add a class of
expand-child
. Or you can pass in your own class name我们有同样的问题并找到了解决方法。我传递了在第二行设置的类名。只需添加以下代码之一:
或
We have the same issue and found a workaround. I pass the class name that I have set on the 2nd row. Just add one of the code below :
or
我正在使用数据表,看看是否对您有帮助
示例: http://datatables.net/examples/
i'm using datatables, take a look and see if helps you
examples: http://datatables.net/examples/