From 9923be2be94b504a4ff8a35f77ca6e1c1e112e10 Mon Sep 17 00:00:00 2001 From: Hugot Maxime Date: Tue, 12 Nov 2013 00:50:00 +0100 Subject: [PATCH] Add new exemple with grouping widget + filter widget + childrow widget Exclude group-header class in filter widget Exclude cssChildRow class in grouping widget Change calculation of colspan in grouping widget Add !important for group-hidden class --- ...mple-widget-grouping-filter-childrows.html | 161 ++++++++++++++++++ docs/index.html | 1 + js/jquery.tablesorter.widgets.js | 2 +- js/widgets/widget-grouping.js | 4 +- 4 files changed, 165 insertions(+), 3 deletions(-) create mode 100644 docs/example-widget-grouping-filter-childrows.html diff --git a/docs/example-widget-grouping-filter-childrows.html b/docs/example-widget-grouping-filter-childrows.html new file mode 100644 index 00000000..7104eeac --- /dev/null +++ b/docs/example-widget-grouping-filter-childrows.html @@ -0,0 +1,161 @@ + + + + + jQuery plugin: Tablesorter 2.0 - Grouping Rows Widget + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Demo

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OrderStatutPriorityPrice
Good ToysUSA80%
1561651finish0$5
558815finish0$55
Cycle ClearanceFRANCE25%
21485213in progress2$7
12547854finish0$18
Cycle Initial Bike CompanyUSA36%
12574521in progress1$5
7895452in progress2$78
1542021finish0$28
4489885finish0$18
Sports StoreUSA90%
18915in progress2$5
5402574in progress2$78
26478finish0$28
25682finish0$18
Locks CompanyUK24%
18915in progress2$5
5402574in progress1$78
26478finish0$28
25682finish0$18
Famous Bike ShopUK12%
185406in progress2$5
541265in progress2$78
+
+ + + diff --git a/docs/index.html b/docs/index.html index ad95355a..fb89789b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -307,6 +307,7 @@
  • Build Table Widget (v2.11).
  • Grouping rows Widget (v2.8; v2.13).
  • +
  • Grouping rows Widget + filter + child rows
  • Repeat Headers widget (v2.0.5; v2.9)
  • Resizable Columns widget (v2.0.23.1; v2.8.3)
  • Save sort widget (v2.0.27)
  • diff --git a/js/jquery.tablesorter.widgets.js b/js/jquery.tablesorter.widgets.js index fe2d31d4..fc703c2f 100644 --- a/js/jquery.tablesorter.widgets.js +++ b/js/jquery.tablesorter.widgets.js @@ -793,7 +793,7 @@ ts.filter = { for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { if ($tbodies.eq(tbodyIndex).hasClass(ts.css.info)) { continue; } // ignore info blocks, issue #264 $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); - $rows = $tbody.children('tr').not('.' + c.cssChildRow); + $rows = $tbody.children('tr').not('.' + c.cssChildRow).not('.group-header'); len = $rows.length; if (combinedFilters === '' || wo.filter_serversideFiltering) { $tbody.children().show().removeClass(wo.filter_filteredRow); diff --git a/js/widgets/widget-grouping.js b/js/widgets/widget-grouping.js index ef142a38..ec3d848d 100644 --- a/js/widgets/widget-grouping.js +++ b/js/widgets/widget-grouping.js @@ -99,7 +99,7 @@ ts.addWidget({ for (k = 0; k < c.$tbodies.length; k++) { n = c.cache[k].normalized; group = ''; // clear grouping across tbodies - $tr = c.$tbodies.eq(k).children('tr'); + $tr = c.$tbodies.eq(k).children('tr').not('.' + c.cssChildRow ); if (wo.group_collapsed && wo.group_collapsible) { $tr.addClass('group-hidden'); } @@ -119,7 +119,7 @@ ts.addWidget({ curr = wo.group_formatter((curr || '').toString(), col, table, c, wo) || curr; } $tr.eq(j).before('' + (wo.group_collapsible ? '' : '') + '' + + '" unselectable="on">' + (wo.group_collapsible ? '' : '') + '' + curr + ''); } }