diff --git a/docs/example-widget-math.html b/docs/example-widget-math.html index cbe42f23..721ca8c7 100644 --- a/docs/example-widget-math.html +++ b/docs/example-widget-math.html @@ -196,6 +196,13 @@
math_prefix
and math_suffix
options. See issue #1305.math_prefix
content prior to parsing table cell values.data-math-target
attribute which allows you to target an element inside the table cell. See the Attribute Settings > Targeting cell content section below.math_rowFilter
option.math_none
option which allows customizing the text added to a cell when there are no matching math elements (.math_rowFilter
option.math_none
option which allows customizing the text added to a cell when there are no matching math elements (.$.tablesorter.formatMask
function.By default, recalculations are performed after:
As of v2.16.2, you can set a mask for each math cell by adding a data-math-mask
data-attribute (the math
part of the data-attribute is obtained from the math_data
setting).
As of v2.16.2, you can set a mask for each math cell by adding a data-math-mask
data-attribute (the math
part of the data-attribute is named from the math_data
setting).
<th data-math="all-sum" data-math-mask="##0.00">all-sum</th>
#
and 0
in the mask, is that when a value of zero is passed to the function, the #
mask will return an empty string whereas the 0
mask will return a zero.$.tablesorter.formatMask( '#,###', 1234567.890)
will output 1234567,890
.$.tablesorter.formatMask( '#,###.', 1234567.890)
which will then output 1,234,567
.+ Recalculate the values of all math cells within the table using the following method: ++$('table').trigger('recalculate');+The triggered
+ This method is automatically called: +'recalculate'
method can be renamed by modifying themath_event
option.+
+- Tablesorter initialization.
+- After any call to a tablesorter method which updates the internal cache (e.g. "update", "updateCell", etc). The math widget listens for the updateComplete event, which occurs after the internal cache has completed updating, before recalculating values.
+- After a "filterReset".
+- And after a "filterEnd" event, or a "pagerComplete" event (if the pager is being used), but not both!
+
+ Note The difference between using #
and 0
in the mask, is that when a value of zero is passed to the function, the #
mask will return an empty string whereas the 0
mask will return a zero.
+
$.tablesorter.formatMask('$#,##0.00 USD', 0); // result: "$0.00 USD" +$.tablesorter.formatMask('$#,###.00 USD', 0); // result: "$.00 USD" +$.tablesorter.formatMask('$#,###.#0 USD', 0); // result: "$.00 USD" +$.tablesorter.formatMask('$#,###.## USD', 0); // result: "$ USD"+ +