@@ -42,6 +42,11 @@ <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a>
</div>
<div id="main">

<p class="tip">
<em>NOTE!</em> The functionality to add a "sortInitialOrder" inside of the "headers" option was added in version 2.0.8 (not part of the original plugin).
</p>

<h1>Demo</h1>
<div id="demo"><table class="tablesorter">
<thead>

Large diffs are not rendered by default.

@@ -29,6 +29,11 @@ <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a>
</div>
<div id="main">

<p class="tip">
<em>NOTE!</em> This functionality was added in version 2.0.11 (it is not part of the original plugin).
</p>

<h1>Demo</h1>
<div id="demo"><table class="tablesorter">
<thead>
@@ -56,6 +56,11 @@ <h3>Flexible client-side table sorting</h3>
</div>

<div id="main">

<p class="tip">
<em>NOTE!</em> Assigning the parser using a class name was added in version 2.0.11 (it is not part of the original plugin).
</p>

<h1>Demo</h1>
<div id="demo"><table class="tablesorter">
<thead>
@@ -83,6 +83,10 @@ <h3>Flexible client-side table sorting</h3>

<div id="switcher"></div>

<p class="tip">
<em>NOTE!</em> This widget can be applied to the original plugin.
</p>

<h1>Demo</h1>
<div id="demo"><table class="tablesorter">
<thead>
@@ -50,7 +50,12 @@ <h3>Flexible client-side table sorting</h3>
<div id="main">

<p class="tip">
<em>NOTE!</em> Click on any value in the Total column to change it to a random amount.
<em>NOTE!</em>
<ul>
<li>Click on any value in the Total column to change it to a random amount.</li>
<li>This option is part of the original plugin.</li>
<li>Automatic resorting after "updateCell" is triggered was added in version 2.0.14.</li>
</ul>
</p>

<h1>Demo</h1>
@@ -36,7 +36,7 @@ <h3>Flexible client-side table sorting</h3>
</div>
<p>
<strong>Author:</strong> <a class="external" href="http://lovepeacenukes.com">Christian Bach</a><br>
<strong>Version:</strong> 2.0.15 (<a href="../changelog.txt">changelog</a>)<br>
<strong>Version:</strong> 2.0.16 (forked from <a href="http://tablesorter.com/docs/">version 2.0.5</a>, <a href="../changelog.txt">changelog</a>)<br>
<strong>Licence:</strong>
Dual licensed under <a class="external" href="http://www.opensource.org/licenses/mit-license.php">MIT</a>
or <a class="external" href="http://www.opensource.org/licenses/gpl-license.php">GPL</a> licenses.
@@ -300,7 +300,7 @@ <h1>Examples</h1>
<li><a href="example-apply-widget.html">Applying widgets</a></li>
<li><a href="example-zebra.html">Applying the zebra stripe widget</a></li>
<li><a href="example-ui-theme.html">Applying the jQuery UI theme widget</a> <span class="tip"><em>New! v2.0.9</em></span></li>
<li><a href="example-options-headers.html">Disable or set the column parser using class names</a> <span class="tip"><em>New! v2.0.11</em></span></li>
<li><a href="example-parsers-class-name.html">Disable or set the column parser using class names</a> <span class="tip"><em>New! v2.0.11</em></span></li>
<li><a href="example-options-headers.html">Disable sort using headers options</a></li>
<li><a href="example-options-headers-locked.html">Lock sort order using header options</a></li>
<li><a href="example-options-headers-order.html">Set initial sort order using header options</a></li>
@@ -317,6 +317,7 @@ <h1>Examples</h1>
<li><a href="example-triggers.html">Triggers sortEnd and sortStart (Displaying sorting progress)</a></li>
<li><a href="example-empty-table.html">Initializing tablesorter on a empty table</a></li>
<li><a href="example-ajax.html">Appending table data with ajax</a></li>
<li><a href="example-add-rows.html">Advanced: Adding a table row</a> <span class="tip"><em>New! v2.0.16</em></span></li>
<li><a href="example-update-cell.html">Update the table after cell content has changed</a></li>
<li><a href="example-option-text-extraction.html">Dealing with markup inside cells (textExtraction function)</a></li>
<li><a href="example-option-render-header.html">Modify how the header is rendered to allow for custom styling</a></li>
@@ -785,6 +786,21 @@ <h1>Methods</h1>
</thead>
<tbody>

<tr id="addrows">
<td><a href="#" class="toggle2">addRows</a></td>
<td>Use this method to add table rows. <span class="tip"><em>New!</em> in v2.0.16</span>
<div class="collapsible">
It does not work the same as "update" in that it only adds rows, it does not remove them.<br>
Also, use this method to add table rows while using the pager plugin. If the "update" method is used, only the visible table rows continue to exist.
<pre class="js">// Add multiple rows to the table
var $row = $('&lt;tr&gt;&lt;td&gt;Inigo&lt;/td&gt;&lt;td&gt;Montoya&lt;/td&gt;&lt;td&gt;34&lt;/td&gt;&lt;td&gt;$19.99&lt;/td&gt;&lt;td&gt;15%&lt;/td&gt;&lt;td&gt;Sep 25, 1987 12:00PM&lt;/td&gt;&lt;/tr&gt;');
$('table')
.find('tbody').append($row)
.trigger('addRows', [$row]);</pre></div>
</td>
<td><a href="example-add-rows.html">Example</a></td>
</tr>

<tr id="sorton">
<td><a href="#" class="toggle2">sorton</a></td>
<td>Use this method to sort an initialized table in the desired order.
@@ -1,6 +1,6 @@
/*
* TableSorter 2.0 - Client-side table sorting with ease!
* Version 2.0.15
* Version 2.0.16
* @requires jQuery v1.2.3
*
* Copyright (c) 2007 Christian Bach
@@ -630,7 +630,7 @@
this.order = this.count++ % 2;
// always sort on the locked order.
if(typeof(this.lockedOrder) !== "undefined" && this.lockedOrder !== false) { this.order = this.lockedOrder; }
// user only whants to sort on one column
// user only wants to sort on one column
if (!e[config.sortMultiSortKey]) {
// flush the sort list
config.sortList = [];
@@ -711,6 +711,25 @@
cache.normalized[pos[0]][pos[1]] = config.parsers[pos[1]].format(getElementText(config, cell, pos[1]), cell);
$this.trigger("sorton", [config.sortList]);
})
.bind("addRows", function(e, row) {
var i, config = this.config, rows = row.filter('tr').length,
dat = [], l = row[0].cells.length;
// add each row
for (i = 0; i < rows; i++) {
// add each cell
for (j = 0; j < l; j++) {
dat[j] = config.parsers[j].format(getElementText(config, row[i].cells[j], j), row[i].cells[j]);
}
// add the row index to the end
dat.push(cache.row.length);
// update cache
cache.row.push([row[i]]);
cache.normalized.push(dat);
dat = [];
}
// resort using current settings
$this.trigger("sorton", [config.sortList]);
})
.bind("sorton", function(e, list) {
$(this).trigger("sortStart", tbl[0]);
config.sortList = list;

Large diffs are not rendered by default.