【发布时间】:2016-06-07 06:30:02
【问题描述】:
首先,我使用的是 TableSorter 2.11.1 和 jquery 1.9.1。
我使用这个演示来分组我的行 (http://mottie.github.io/tablesorter/docs/example-widget-grouping.html) 我按日期对表格进行排序,然后像这张图片一样按周对表格进行分组
我想要的是在分组栏中添加一周的总价格。比如一周的行数。
我在 widget-grouping.js 中搜索,找到了计算一周行数的代码
$tr = c.$table.find('tr.group-header').bind('selectstart', false);
if (wo.group_count) {
$tr.each(function(){
$(this).find('.group-count').html( wo.group_count.replace(/\{num\}/g, $(this).nextUntil('tr.group-header').filter(':visible').length) );
});
}
我不是 jquery 方面的专家,所以我找不到获取价格并将其添加到组标题的方法。
【问题讨论】:
-
你能创建jsfiddle吗
-
jsfiddle.net/pZcY7 这里是 jsfiddle,但我复制了我的代码,但我的工作不如在我的电脑上好:/这是我第一次使用这个工具。
标签: jquery grouping tablesorter