From fb16792adf9c58d801804bfe483aa51e795f396a Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sun, 13 Dec 2015 05:37:38 -0600 Subject: [PATCH] Math: fix data-math-filter error. See #1083 --- docs/example-widget-math.html | 6 +++--- js/widgets/widget-math.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/example-widget-math.html b/docs/example-widget-math.html index 86e5ffb8..0861ec1a 100644 --- a/docs/example-widget-math.html +++ b/docs/example-widget-math.html @@ -451,7 +451,7 @@ math_suffix : '{content}!' '' - Set this option apply a filter to targeted rows (v2.24.6). + Set this option apply a filter to targeted rows (v2.24.6; v2.24.7).

This option applys the set filter (jQuery .filter() to the targeted rows.

If this option is set, rows filtered out by the filter widget are included, so you will need to include them in this selector if you wish to filter them out (e.g. ':visible:not(.filtered)' (only include visible & rows not filtered out by the filter widget)

@@ -459,8 +459,8 @@ math_suffix : '{content}!' // for example, here is the functional equivalent // math_rowFilter : function(index, element) { return $(element).is(':visible:not(.filtered)'); } math_rowFilter : ':visible:not(.filtered)' - In v2.24.7, this setting my be overridden in specific rows by adding a data-math-filter attribute (The "math" portion is set by the math_data option) -
<tr data-math-filter=":visible">...</tr>
+ In v2.24.7, this setting my be overridden for each math type by adding a data-math-filter attribute (The "math" portion is set by the math_data option) to the cell. +
<td data-math-filter=":visible" data-math="all-sum">...</td>
Note The data-math-filter attribute is ignored if set to an empty string; instead use data-math-filter="*" to target all rows as done in the first example on this page.
diff --git a/js/widgets/widget-math.js b/js/widgets/widget-math.js index 9b3aa052..8f5acc00 100644 --- a/js/widgets/widget-math.js +++ b/js/widgets/widget-math.js @@ -313,7 +313,7 @@ if ( $el.parent().hasClass( wo.filter_filteredRow || 'filtered' ) ) { continue; } - hasFilter = hasFilter || $el.attr( mathAttr + '-filter' ) || wo.math_rowFilter; + hasFilter = $el.attr( mathAttr + '-filter' ) || wo.math_rowFilter; formula = ( $el.attr( mathAttr ) || '' ).replace( type + '-', '' ); arry = ( type === 'row' ) ? math.getRow( c, $el, hasFilter ) : ( type === 'all' ) ? getAll : math.getColumn( c, $el, type, hasFilter );