diff --git a/docs/index.html b/docs/index.html index edcf5a1a..183d09ff 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1314,14 +1314,34 @@ From the example function above, you'll end up with something similar to this HT
textExtraction
function. Add it to the cell(s) as follows:
+ <td data-text="1">First repository</td>+ Note This option only works when the
textExtraction
option is set to "basic".
+ "simple"
which is the equivalent of doing this inside of the textExtraction function: $(node).text();
.
+ textAttribute
option).textExtraction
option to any name other than "basic".var myTextExtraction = function(node, table, cellIndex){ // extract data from markup and return it @@ -1331,9 +1351,9 @@ From the example function above, you'll end up with something similar to this HT $(function(){ $("#myTable").tablesorter( { textExtraction: myTextExtraction } ); });- tablesorter will pass the current table cell object for you to parse and return. Thanks to Josh Nathanson for the examples. Updated to a jQuery example by Rob G (Mottie). + tablesorter will pass the current table cell object for you to parse and return. Thanks to Josh Nathanson for the examples; updated to a jQuery example by Rob G (Mottie).
Now if the text you are finding in the script above is say a number, then just include the headers
sorter option to specify how to sort it. Also in this example, we will specify that the special textExtraction code is only needed for the second column (1
because we are using a zero-based index). All other columns will ignore this textExtraction function.
Added table
and cellIndex
variables to the textExtraction
function in version 2.1.2.
Added table
and cellIndex
variables to the textExtraction
function in version 2.1.2 (this is not part of the original plugin).
$(function(){ $("table").tablesorter({ textExtraction: { @@ -1345,7 +1365,9 @@ $(function(){ 1: { sorter : "digit" } } }); -});
"basic"
(modified v2.16.0) which is the equivalent of doing this inside of the textExtraction function: $(node).text();
.
+
test-head | num | |
---|---|---|
test-foot | txt | |
test2 | x2 | |
test1 | x3 | |
test3 | x1 | |
ignored | x2 | |
ignored | x3 | |
ignored | x1 | |
Info |
1 | @@ -83,7 +83,7 @@|||
---|---|---|---|
A43 | -35 | 01 | -.1 |
A43 | -35 | 01 | -.1 |
A255 | 33 | 02 | N/A #1 |
A33 | 2 | 03 | N/A #2 |
A1 | -5 | 04 | -8.4 |
testd | 7 |