Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit 7fe9a4e

Browse files
committed
docs(#1244): fix buttons example for excel export
1 parent d73f2f7 commit 7fe9a4e

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

demo/angular.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"scripts": [
3535
"node_modules/jquery/dist/jquery.js",
3636
"node_modules/tether/dist/js/tether.js",
37+
"node_modules/jszip/dist/jszip.js",
3738
"node_modules/datatables.net/js/jquery.dataTables.js",
3839
"node_modules/datatables.net-buttons/js/dataTables.buttons.js",
3940
"node_modules/datatables.net-buttons/js/buttons.colVis.js",
@@ -93,6 +94,7 @@
9394
"node_modules/jquery/dist/jquery.js",
9495
"node_modules/tether/dist/js/tether.js",
9596
"node_modules/datatables.net/js/jquery.dataTables.js",
97+
"node_modules/jszip/dist/jszip.js",
9698
"node_modules/datatables.net-buttons/js/dataTables.buttons.js",
9799
"node_modules/datatables.net-buttons/js/buttons.colVis.js",
98100
"node_modules/datatables.net-buttons/js/buttons.flash.js",
@@ -169,4 +171,4 @@
169171
"prefix": "app"
170172
}
171173
}
172-
}
174+
}

demo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"datatables.net-select-dt": "^1.2.3",
3838
"highlight.js": "^9.12.0",
3939
"jquery": "^3.2.1",
40+
"jszip": "^3.1.5",
4041
"materialize-css": "0.100.2",
4142
"rxjs": "^6.1.0",
4243
"rxjs-compat": "^6.1.0",

demo/src/app/extensions/buttons-extension-configuration.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ import { Component } from '@angular/core';
1515
<h4 id="angular-cli">.angular-cli.json</h4>
1616
<p>Add the dependencies in the scripts and styles attributes:</p>
1717
<section [innerHTML]="angularCliJsonSnippet" highlight-js-content=".json"></section>
18+
<blockquote>If you want to have the excel export functionnality, then you must import the <code>jszip.js</code> before the <code>buttons.html5.js</code> file.</blockquote>
1819
</div>
1920
`
2021
})
2122
export class ButtonsExtensionConfigurationComponent {
2223
npmInstallSnippet = `
2324
<pre>
24-
<code class="bash highlight"># JS file
25+
<code class="bash highlight"># If you want to export excel files
26+
npm install jszip --save
27+
# JS file
2528
npm install datatables.net-buttons --save
2629
# CSS file
2730
npm install datatables.net-buttons-dt --save
@@ -41,6 +44,7 @@ npm install @types/datatables.net-buttons --save-dev
4144
],
4245
"scripts": [
4346
...
47+
"../node_modules/jszip/dist/jszip.js",
4448
"../node_modules/datatables.net-buttons/js/dataTables.buttons.js",
4549
"../node_modules/datatables.net-buttons/js/buttons.colVis.js",
4650
"../node_modules/datatables.net-buttons/js/buttons.flash.js",

0 commit comments

Comments
 (0)