Skip to content

Commit 05a6228

Browse files
authored
Merge pull request #70 from DHTMLX/next
[update] actualize export-related docs
2 parents bb8828a + 42374be commit 05a6228

3 files changed

Lines changed: 23 additions & 18 deletions

File tree

docs/api/spreadsheet_exportmodulepath_config.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exportModulePath?: string;
2020

2121
~~~jsx {2}
2222
const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
23-
exportModulePath: "../libs/json2excel/1.0/worker.js",
23+
exportModulePath: "../libs/json2excel/x.x/worker.js?vx", // a local path to the `worker.js` file of the export module
2424
// other config parameters
2525
});
2626
~~~
@@ -31,14 +31,12 @@ const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
3131
DHTMLX Spreadsheet uses the WebAssembly-based library [JSON2Excel](https://github.com/dhtmlx/json2excel) for export of data into Excel.
3232
:::
3333

34-
To export files you need to:
34+
To export files you need to set the path to the **worker.js** file of the [Json2Excel](https://github.com/dhtmlx/json2excel) library (where export will be processed) via the **exportModulePath** option. By default, `https://cdn.dhtmlx.com/libs/json2excel/next/worker.js?vx` is used.
35+
- if you use the public export server, you don't need to specify the link to it, since it is used by default
36+
- if you use your own export server, you need to:
37+
- install the [**Json2Excel**](https://github.com/dhtmlx/json2excel) library
38+
- use `"../libs/json2excel/x.x/worker.js?vx"` for a specific version (replace `x.x` with the version deployed on your server)
3539

36-
- install the **JSON2excel** library
37-
- set the path to the **worker.js** file via the **exportModulePath** option in one of the two ways:
38-
- by providing a local path to the file on your computer, like: `"../libs/json2excel/1.0/worker.js"`
39-
- by providing a link to the file from CDN: `"https://cdn.dhtmlx.com/libs/json2excel/1.0/worker.js"`
40-
41-
By default the link to CDN is used.
4240

4341
**Related articles:** [Data loading and export](loading_data.md#exporting-data)
4442

docs/loading_data.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,21 @@ DHTMLX Spreadsheet provides the ability to export data from a spreadsheet into a
300300

301301
#### How to export data
302302

303-
{{note Please note that the export feature won't work in the Internet Explorer browser.}}
303+
:::note
304+
Please note that the export feature won't work in the Internet Explorer browser.
305+
:::
304306

305-
The library uses the WebAssembly-based library [Json2Excel](https://github.com/dhtmlx/json2excel) to enable the functionality of export to Excel. Thus, to have the possibility of exporting files you need to:
307+
The library uses the WebAssembly-based library [Json2Excel](https://github.com/dhtmlx/json2excel) to enable the functionality of export to Excel. Export is processed at the **worker.js** file of the **Json2Excel** library (the default link is `https://cdn.dhtmlx.com/libs/json2excel/next/worker.js?vx`). You can use either the public export server or a local export server. Thus, to have the possibility of exporting files you need to:
306308

307-
- install the **JSON2Excel** library
308-
- specify the [](api/spreadsheet_exportmodulepath_config.md) option in the Spreadsheet configuration and set the path to the **worker.js** file in one of the two ways:
309-
- by providing a local path to the file on your computer, like: `"../libs/json2excel/1.0/worker.js"`
310-
- by providing a link to the file from CDN: `"https://cdn.dhtmlx.com/libs/json2excel/1.0/worker.js"`
309+
- specify the [](api/spreadsheet_exportmodulepath_config.md) option in the Spreadsheet configuration and set the path to the **worker.js** file:
310+
- if you use the public export server, you don't need to specify the link to it, since it is used by default
311+
- if you use your own export server, you need to:
312+
- install the [**Json2Excel**](https://github.com/dhtmlx/json2excel) library
313+
- use `"../libs/json2excel/x.x/worker.js?vx"` for a specific version (replace `x.x` with the version deployed on your server)
311314

312315
~~~jsx
313316
var spreadsheet = new dhx.Spreadsheet(document.body, {
314-
exportModulePath: "../libs/json2excel/1.0/worker.js"
317+
exportModulePath: "../libs/json2excel/x.x/worker.js?vx" // the path to the export module, if a local export server is used
315318
});
316319
~~~
317320

@@ -325,7 +328,9 @@ spreadsheet.export.xlsx();
325328

326329
**Related sample**: [Spreadsheet. Export Xlsx](https://snippet.dhtmlx.com/btyo3j8s?tag=spreadsheet)
327330

328-
{{note Please note that the component supports export to Excel files with the **.xlsx** extension only.}}
331+
:::note
332+
Please note that the component supports export to Excel files with the `.xlsx` extension only.
333+
:::
329334

330335
#### How to set a custom name for an exported file
331336

docs/react/props.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,13 @@ Enable sheet tabs with `multiSheets={true}`. Pass `false` to hide the tab bar en
169169
~~~tsx
170170
<ReactSpreadsheet
171171
sheets={sheets}
172-
importModulePath="../libs/excel2json/1.0/worker.js"
173-
exportModulePath="../libs/json2excel/1.0/worker.js"
172+
importModulePath="../libs/excel2json/next/worker.js"
173+
exportModulePath="../libs/json2excel/next/worker.js"
174174
/>
175175
~~~
176176

177+
To use a specific version, replace `next` with the version number (check the [Excel2Json](https://github.com/dhtmlx/excel2json) and [Json2Excel](https://github.com/dhtmlx/json2excel) GitHub repositories).
178+
177179
### European number formatting
178180

179181
~~~tsx

0 commit comments

Comments
 (0)