Skip to content
This repository has been archived by the owner on Jul 25, 2021. It is now read-only.

Commit

Permalink
v3.2.12 – add emptyCSS property to replace cells values with an emp…
Browse files Browse the repository at this point in the history
…ty string in the exported file
  • Loading branch information
Travis Clarke authored and Travis Clarke committed Oct 1, 2016
1 parent 0b27ef1 commit 24e9695
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 15 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ $("table").tableExport({
position: "bottom", // (top, bottom), position of the caption element relative to table
ignoreRows: null, // (Number, Number[]), row indices to exclude from the exported file
ignoreCols: null, // (Number, Number[]), column indices to exclude from the exported file
ignoreCSS: ".tableexport-ignore" // (selector, selector[]), selector(s) to exclude from the exported file
ignoreCSS: ".tableexport-ignore" // (selector, selector[]), selector(s) to exclude cells from the exported file
emptyCSS: ".tableexport-empty" // (selector, selector[]), selector(s) to replace cells with an empty string in the exported file
});
```
> **Note:** to use the xlsx filetype, you must include the third-party scripts listed in the Dependencies section.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tableexport.js",
"version": "3.2.11",
"version": "3.2.12",
"authors": [
"clarketm <[email protected]>"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/css/tableexport.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* TableExport.js v3.2.11 (https://www.travismclarke.com)
* TableExport.js v3.2.12 (https://www.travismclarke.com)
* Copyright 2016 Travis Clarke
* Licensed under the MIT license
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/css/tableexport.min.css

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

21 changes: 19 additions & 2 deletions dist/js/tableexport.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* TableExport.js v3.2.11 (https://www.travismclarke.com)
* TableExport.js v3.2.12 (https://www.travismclarke.com)
* Copyright 2016 Travis Clarke
* Licensed under the MIT license
*/
Expand Down Expand Up @@ -41,6 +41,7 @@
ignoreRows = self.settings.ignoreRows instanceof Array ? self.settings.ignoreRows : [self.settings.ignoreRows],
ignoreCols = self.settings.ignoreCols instanceof Array ? self.settings.ignoreCols : [self.settings.ignoreCols],
ignoreCSS = self.settings.ignoreCSS instanceof Array ? self.settings.ignoreCSS.join(", ") : self.settings.ignoreCSS,
emptyCSS = self.settings.emptyCSS instanceof Array ? self.settings.emptyCSS.join(", ") : self.settings.emptyCSS,
bootstrapClass, bootstrapTheme, bootstrapSpacing;

if (self.settings.bootstrap) {
Expand Down Expand Up @@ -74,6 +75,9 @@
if (!!~ignoreCols.indexOf(ic) || $(val).is(ignoreCSS)) {
return;
}
if ($(val).is(emptyCSS)) {
return " "
}
if (val.hasAttribute('colspan')) {
rcMap[ir] = rcMap[ir] || {};
rcMap[ir][ic+1] = val.getAttribute('colspan') - 1
Expand Down Expand Up @@ -112,6 +116,9 @@
if (!!~ignoreCols.indexOf(ic) || $(val).is(ignoreCSS)) {
return;
}
if ($(val).is(emptyCSS)) {
return " "
}
if (val.hasAttribute('colspan')) {
rcMap[ir] = rcMap[ir] || {};
rcMap[ir][ic+1] = val.getAttribute('colspan') - 1
Expand Down Expand Up @@ -150,6 +157,9 @@
if (!!~ignoreCols.indexOf(i) || $(val).is(ignoreCSS)) {
return;
}
if ($(val).is(emptyCSS)) {
return " "
}
return $(val).text();
}).get().join(colD);
}).get().join(rdel),
Expand All @@ -175,6 +185,9 @@
if (!!~ignoreCols.indexOf(i) || $(val).is(ignoreCSS)) {
return;
}
if ($(val).is(emptyCSS)) {
return " "
}
return $(val).text();
}).get().join(colD);
}).get().join(rdel),
Expand All @@ -200,6 +213,9 @@
if (!!~ignoreCols.indexOf(i) || $(val).is(ignoreCSS)) {
return;
}
if ($(val).is(emptyCSS)) {
return " "
}
return $(val).text();
}).get().join(colD);
}).get().join(rdel),
Expand Down Expand Up @@ -264,7 +280,8 @@
position: "bottom", // (top, bottom), position of the caption element relative to table, (default: "bottom")
ignoreRows: null, // (Number, Number[]), row indices to exclude from the exported file (default: null)
ignoreCols: null, // (Number, Number[]), column indices to exclude from the exported file (default: null)
ignoreCSS: ".tableexport-ignore" // (selector, selector[]), selector(s) to exclude from the exported file (default: ".tableexport-ignore")
ignoreCSS: ".tableexport-ignore", // (selector, selector[]), selector(s) to exclude cells from the exported file (default: ".tableexport-ignore")
emptyCSS: ".tableexport-empty" // (selector, selector[]), selector(s) to replace cells with an empty string in the exported file (default: ".tableexport-empty")
},
/**
* Character set (character encoding) of the HTML.
Expand Down
Loading

0 comments on commit 24e9695

Please sign in to comment.