Skip to content

Commit d9e1d48

Browse files
committed
[update] rework export path docs to public vs own server framing
- replace local-path/CDN bullet structure with public-vs-own-server approach - update code examples to use x.x/worker.js?vx instead of next - fix admonition syntax from {{note}} to :::note in loading_data.md - remove inline comments from React props code example
1 parent 0c8f90e commit d9e1d48

3 files changed

Lines changed: 21 additions & 26 deletions

File tree

‎docs/api/spreadsheet_exportmodulepath_config.md‎

Lines changed: 6 additions & 12 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/next/worker.js", // latest version; use x.x instead of next for a specific version
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,18 +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:
39-
- use `"../libs/json2excel/next/worker.js"` for the latest version
40-
- use `"../libs/json2excel/x.x/worker.js"` for a specific version (replace `x.x` with the actual version from the [GitHub repository](https://github.com/dhtmlx/json2excel))
41-
- by providing a link to the file from CDN:
42-
- use `"https://cdn.dhtmlx.com/libs/json2excel/next/worker.js?vx"` for the latest version
43-
- use `"https://cdn.dhtmlx.com/libs/json2excel/x.x/worker.js?vx"` for a specific version (replace `x.x` with the actual version from the [GitHub repository](https://github.com/dhtmlx/json2excel))
44-
45-
By default, `https://cdn.dhtmlx.com/libs/json2excel/next/worker.js?vx` is used.
4640

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

‎docs/loading_data.md‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -300,22 +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:
310-
- use `"../libs/json2excel/next/worker.js"` for the latest version
311-
- use `"../libs/json2excel/x.x/worker.js"` for a specific version (replace `x.x` with the actual version from the [GitHub repository](https://github.com/dhtmlx/json2excel))
312-
- by providing a link to the file from CDN:
313-
- use `"https://cdn.dhtmlx.com/libs/json2excel/next/worker.js?vx"` for the latest version
314-
- use `"https://cdn.dhtmlx.com/libs/json2excel/x.x/worker.js?vx"` for a specific version (replace `x.x` with the actual version from the [GitHub repository](https://github.com/dhtmlx/json2excel))
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)
315314

316315
~~~jsx
317316
var spreadsheet = new dhx.Spreadsheet(document.body, {
318-
exportModulePath: "../libs/json2excel/next/worker.js" // latest version; use x.x instead of next for a specific version
317+
exportModulePath: "../libs/json2excel/x.x/worker.js?vx" // the path to the export module, if a local export server is used
319318
});
320319
~~~
321320

@@ -329,7 +328,9 @@ spreadsheet.export.xlsx();
329328

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

332-
{{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+
:::
333334

334335
#### How to set a custom name for an exported file
335336

‎docs/react/props.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ 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/next/worker.js" // latest version; use x.x instead of next for a specific version
173-
exportModulePath="../libs/json2excel/next/worker.js" // latest version; use x.x instead of next for a specific version
172+
importModulePath="../libs/excel2json/next/worker.js"
173+
exportModulePath="../libs/json2excel/next/worker.js"
174174
/>
175175
~~~
176176

0 commit comments

Comments
 (0)