Skip to content

Commit

Permalink
Output: add output_hiddenColumns option. Fixes #869
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Apr 13, 2015
1 parent cd784f6 commit d19985e
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dist/js/jquery.tablesorter.combined.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 04-10-2015 (v2.21.5)*/
/*! tablesorter (FORK) - updated 04-13-2015 (v2.21.5)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
Expand Down
2 changes: 1 addition & 1 deletion dist/js/jquery.tablesorter.combined.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/jquery.tablesorter.widgets.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 04-10-2015 (v2.21.5)*/
/*! tablesorter (FORK) - updated 04-13-2015 (v2.21.5)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
Expand Down
2 changes: 1 addition & 1 deletion dist/js/jquery.tablesorter.widgets.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/widgets/widget-output.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions docs/example-widget-output.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
filter_reset : demos[groupIndex] + ' .reset',
output_separator : ',', // ',' 'json', 'array' or separator (e.g. ',')
output_ignoreColumns : [], // columns to ignore [0, 1,... ] (zero-based index)
output_hiddenColumns : false, // include hidden columns in the output
output_includeFooter : true, // include footer rows in the output
output_dataAttrib : 'data-name', // data-attribute containing alternate cell text
output_headerRows : true, // output all header rows (multiple rows)
Expand Down Expand Up @@ -222,7 +223,12 @@ <h3><a href="#">Notes</a></h3>

<h4>Changes</h4>
<ul>
<li>In <span class="version">v2.21.6</span>, added the BOM back to the UTF-8 csv downloadable file to support unicode characters in Excel.</li>
<li>In <span class="version">v2.21.6</span>,
<ul>
<li>Added the BOM back to the UTF-8 csv downloadable file to support unicode characters in Excel.</li>
<li>Add <code>output_hiddenColumns</code> which includes hidden columns in the output when <code>true</code>.</li>
</ul>
</li>
<li>In <span class="version">v2.21.0</span>, added the <code>output_includeFooter</code> option.</li>
<li>In <span class="version">v2.17.5</span>, the need to modify the server's content disposition no longer exists.</li>
<li>In <span class="version">v2.17.0</span>,
Expand Down Expand Up @@ -454,6 +460,13 @@ <h4>Output widget default options (added inside of tablesorter <code>widgetOptio
</div>
</td>
</tr>
<tr id="output_hiddencolumns">
<td><span class="permalink">output_hiddenColumns</span></td>
<td><code>false</code></td>
<td>
Include hidden columns (using <code>display: none</code>) in the output (<span class="version">v2.21.6</span>).
</td>
</tr>
<tr id="output_includefooter">
<td><span class="permalink">output_includeFooter</span></td>
<td><code>false</code></td>
Expand Down Expand Up @@ -960,4 +973,3 @@ <h1>HTML</h1>

</body>
</html>

2 changes: 1 addition & 1 deletion js/jquery.tablesorter.combined.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀▀██
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
*/
/*! tablesorter (FORK) - updated 04-10-2015 (v2.21.5)*/
/*! tablesorter (FORK) - updated 04-13-2015 (v2.21.5)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
Expand Down
2 changes: 1 addition & 1 deletion js/jquery.tablesorter.widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀▀██
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
*/
/*! tablesorter (FORK) - updated 04-10-2015 (v2.21.5)*/
/*! tablesorter (FORK) - updated 04-13-2015 (v2.21.5)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
Expand Down
5 changes: 3 additions & 2 deletions js/widgets/widget-output.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ output = ts.output = {
}
}

// don't include hidden columns
if ( $this.css('display') !== 'none' ) {
// don't include hidden columns, unless option is set
if ( !wo.output_hiddenColumns && $this.css('display') !== 'none' ) {
// skip column if already defined
while (typeof tmpRow[rowIndex][cellIndex] !== 'undefined') { cellIndex++; }
tmpRow[rowIndex][cellIndex] = tmpRow[rowIndex][cellIndex] ||
Expand Down Expand Up @@ -295,6 +295,7 @@ ts.addWidget({
options: {
output_separator : ',', // set to "json", "array" or any separator
output_ignoreColumns : [], // columns to ignore [0, 1,... ] (zero-based index)
output_hiddenColumns : false, // include hidden columns in the output
output_includeFooter : false, // include footer rows in the output
output_dataAttrib : 'data-name', // header attrib containing modified header name
output_headerRows : false, // if true, include multiple header rows (JSON only)
Expand Down

0 comments on commit d19985e

Please sign in to comment.