Skip to content

Commit

Permalink
export hidden cells optionally
Browse files Browse the repository at this point in the history
  • Loading branch information
hhurz committed Aug 5, 2015
1 parent 1f28bdb commit 516cdcf
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 72 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,6 @@ Optional html data attributes
(can be set while generating the table you want to export)
```html
<td style="display:none;" data-tableexport-display="always">...</td> -> hidden cell will be exported
<td data-tableexport-display="none">...</td> -> cell will not be exported
```
6 changes: 4 additions & 2 deletions tableExport.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,10 @@
function ForEachVisibleCell(tableRow, selector, rowIndex, cellcallback) {

$(tableRow).filter(':visible').find(selector).each(function (colIndex) {
if ($(this).css('display') != 'none' &&
$(this).data("tableexport-display") != 'none') {
if ($(this).data("tableexport-display") == 'always' ||
($(this).css('display') != 'none' &&
$(this).css('visibility') != 'hidden' &&
$(this).data("tableexport-display") != 'none')) {
if (defaults.ignoreColumn.indexOf(colIndex) == -1) {
if (typeof (cellcallback) === "function") {
var cs = 0; // colspan value
Expand Down
Loading

0 comments on commit 516cdcf

Please sign in to comment.