Skip to content

Commit

Permalink
emptyToBottom updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Apr 18, 2012
1 parent 2974c7b commit a5607ae
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
6 changes: 6 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ tablesorter can successfully parse and sort many types of data including linked

View the [complete listing here](https://github.com/Mottie/tablesorter/wiki/Change).

#### Version 2.1.15 (4/18/2012)

* Modified the `emptyAtBottom` option:
* Clarified that setting this option to `null` will treat empty cells as if they had a value of zero. Fix for [issue #48](https://github.com/Mottie/tablesorter/issues/48).
* Modified the script so that empty cells do not call their respective parser to keep the `emptyAtBottom` functionality working properly. Fix for [issue #49](https://github.com/Mottie/tablesorter/issues/49).

#### Version 2.1.14 (4/17/2012)

* Updated "shortDate" parser to include the time, if provided. I've also updated the [Changing the date format](http://mottie.github.com/tablesorter/docs/example-option-date-format.html) demo with a few times.
Expand Down
29 changes: 28 additions & 1 deletion docs/example-option-sort-empty.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h3>Flexible client-side table sorting</h3>
<ul>
<li>true - sort empty table cells to the bottom.</li>
<li>false - sort empty table cells to the top.</li>
<li>null - sort empty table cells as if the cell has the lowest value (less than "a" and "0").</li>
<li>null - sort empty table cells as if the cell has the value equal to zero.</li>
</ul>
</p>

Expand Down Expand Up @@ -121,6 +121,33 @@ <h1>Demo</h1>
<td>23%</td>
<td></td>
</tr>
<tr>
<td>A109</td>
<td>Larry</td>
<td>Stevens</td>
<td>56</td>
<td>153.19</td>
<td>23%</td>
<td>0</td>
</tr>
<tr>
<td>A99</td>
<td>John</td>
<td>Smithy</td>
<td>56</td>
<td>156</td>
<td>22%</td>
<td></td>
</tr>
<tr>
<td>A119</td>
<td>Mike</td>
<td>Rowe</td>
<td>55</td>
<td>-53.99</td>
<td>13%</td>
<td>0</td>
</tr>
</tbody>
</table></div>

Expand Down
6 changes: 3 additions & 3 deletions js/jquery.tablesorter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* TableSorter 2.1.14 - Client-side table sorting with ease!
* TableSorter 2.1.15 - Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
* Copyright (c) 2007 Christian Bach
Expand All @@ -18,7 +18,7 @@
$.extend({
tablesorter: new function(){

this.version = "2.1.14";
this.version = "2.1.15";

var parsers = [], widgets = [], tbl;
this.defaults = {
Expand Down Expand Up @@ -203,7 +203,7 @@
for (j = 0; j < totalCells; ++j) {
t = trimAndGetNodeText(table.config, c[0].cells[j], j);
// don't bother parsing if the string is empty - previously parsing would change it to zero
cols.push( parsers[j].format(t, table, c[0].cells[j], j) );
cols.push( t === '' ? '' : parsers[j].format(t, table, c[0].cells[j], j) );
}
cols.push(cache.normalized.length); // add position for rowCache
cache.normalized.push(cols);
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.tablesorter.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tablesorter",
"version": "2.1.14",
"version": "2.1.15",
"title": "tablesorter",
"author": {
"name": "Christian Bach",
Expand Down

0 comments on commit a5607ae

Please sign in to comment.