Skip to content

Commit aae974e

Browse files
author
Victory
committed
Merge branch 'next'
2 parents f58fce7 + c5a543d commit aae974e

File tree

71 files changed

+2003
-57
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2003
-57
lines changed

docs/api/api_overview.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Parameters:
4949
| [](api/spreadsheet_setactivesheet_method.md) | @getshort(api/spreadsheet_setactivesheet_method.md) |
5050
| [](api/spreadsheet_setformat_method.md) | @getshort(api/spreadsheet_setformat_method.md) |
5151
| [](api/spreadsheet_setstyle_method.md) | @getshort(api/spreadsheet_setstyle_method.md) |
52+
| [](api/spreadsheet_setvalidation_method.md) | @getshort(api/spreadsheet_setvalidation_method.md) |
5253
| [](api/spreadsheet_setvalue_method.md) | @getshort(api/spreadsheet_setvalue_method.md) |
5354
| [](api/spreadsheet_startedit_method.md) | @getshort(api/spreadsheet_startedit_method.md) |
5455
| [](api/spreadsheet_undo_method.md) | @getshort(api/spreadsheet_undo_method.md) |
@@ -58,6 +59,7 @@ Parameters:
5859

5960
| Name | Description |
6061
| :---------------------------------------------- | :----------------------------------------------------- |
62+
| [](api/spreadsheet_afteraction_event.md) | @getshort(api/spreadsheet_afteraction_event.md) |
6163
| [](api/spreadsheet_afterclear_event.md) | @getshort(api/spreadsheet_afterclear_event.md) |
6264
| [](api/spreadsheet_aftercolumnadd_event.md) | @getshort(api/spreadsheet_aftercolumnadd_event.md) |
6365
| [](api/spreadsheet_aftercolumndelete_event.md) | @getshort(api/spreadsheet_aftercolumndelete_event.md) |
@@ -75,6 +77,7 @@ Parameters:
7577
| [](api/spreadsheet_aftersheetrename_event.md) | @getshort(api/spreadsheet_aftersheetrename_event.md) |
7678
| [](api/spreadsheet_afterstylechange_event.md) | @getshort(api/spreadsheet_afterstylechange_event.md) |
7779
| [](api/spreadsheet_aftervaluechange_event.md) | @getshort(api/spreadsheet_aftervaluechange_event.md) |
80+
| [](api/spreadsheet_beforeaction_event.md) | @getshort(api/spreadsheet_beforeaction_event.md) |
7881
| [](api/spreadsheet_beforeclear_event.md) | @getshort(api/spreadsheet_beforeclear_event.md) |
7982
| [](api/spreadsheet_beforecolumnadd_event.md) | @getshort(api/spreadsheet_beforecolumnadd_event.md) |
8083
| [](api/spreadsheet_beforecolumndelete_event.md) | @getshort(api/spreadsheet_beforecolumndelete_event.md) |
@@ -98,7 +101,7 @@ Parameters:
98101
| Name | Description |
99102
| ---------------------------------------------- | ----------------------------------------------------- |
100103
| [](api/spreadsheet_colscount_config.md) | @getshort(api/spreadsheet_colscount_config.md) |
101-
| [](api/spreadsheet_dateformat_config.md) | @getshort(api/spreadsheet_dateformat_config.md) |
104+
| [](api/spreadsheet_dateformat_config.md) | @getshort(api/spreadsheet_dateformat_config.md) |
102105
| [](api/spreadsheet_editline_config.md) | @getshort(api/spreadsheet_editline_config.md) |
103106
| [](api/spreadsheet_exportmodulepath_config.md) | @getshort(api/spreadsheet_exportmodulepath_config.md) |
104107
| [](api/spreadsheet_formats_config.md) | @getshort(api/spreadsheet_formats_config.md) |
@@ -108,7 +111,9 @@ Parameters:
108111
| [](api/spreadsheet_multisheets_config.md) | @getshort(api/spreadsheet_multisheets_config.md) |
109112
| [](api/spreadsheet_readonly_config.md) | @getshort(api/spreadsheet_readonly_config.md) |
110113
| [](api/spreadsheet_rowscount_config.md) | @getshort(api/spreadsheet_rowscount_config.md) |
114+
| [](api/spreadsheet_timeformat_config.md) | @getshort(api/spreadsheet_timeformat_config.md) |
111115
| [](api/spreadsheet_toolbarblocks_config.md) | @getshort(api/spreadsheet_toolbarblocks_config.md) |
116+
| [](api/spreadsheet_topsplit_config.md) | @getshort(api/spreadsheet_topsplit_config.md) |
112117

113118
## Selection methods
114119

@@ -132,4 +137,5 @@ Parameters:
132137

133138
| Name | Description |
134139
| ----------------------------- | ------------------------------------ |
140+
| [](api/export_json_method.md) | @getshort(api/export_json_method.md) |
135141
| [](api/export_xlsx_method.md) | @getshort(api/export_xlsx_method.md) |

docs/api/export_json_method.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
sidebar_label: json()
3+
title: json export method
4+
description: You can learn about the json export method in the documentation of the DHTMLX JavaScript Spreadsheet library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Spreadsheet.
5+
---
6+
7+
# json()
8+
9+
### Description
10+
11+
@short: Exports data from a spreadsheet into a JSON file
12+
13+
### Usage
14+
15+
~~~jsx
16+
json(): void;
17+
~~~
18+
19+
### Example
20+
21+
~~~jsx {5}
22+
const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
23+
// config parameters
24+
});
25+
// exports data from a spreadsheet into a JSON file
26+
spreadsheet.export.json();
27+
~~~
28+
29+
**Changelog:** Added in v4.3
30+
31+
**Related articles:** [Data loading and export](loading_data.md)
32+
33+
**Related sample:** [Spreadsheet. Export/import JSON](https://snippet.dhtmlx.com/e3xct53l)
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
sidebar_label: Spreadsheet actions
3+
title: Actions Overview
4+
description: You can have an Actions overview of the DHTMLX JavaScript Spreadsheet library in the documentation. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Spreadsheet.
5+
---
6+
7+
# Actions overview
8+
9+
This section is dedicated to a new conception of interaction with Spreadsheet events.
10+
11+
Starting from v4.3, DHTMLX Spreadsheet includes a pair of the [beforeAction](api/spreadsheet_beforeaction_event.md)/[afterAction](api/spreadsheet_afteraction_event.md) events that are intended to make your code simple and concise. They will fire right before an action is executed and indicate which exactly action has been performed.
12+
13+
~~~js
14+
spreadsheet.events.on("beforeAction", (actionName, config) => {
15+
if (actionName === "addColumn") {
16+
console.log(actionName, config);
17+
return false;
18+
},
19+
// more actions
20+
});
21+
22+
spreadsheet.events.on("afterAction", (actionName, config) => {
23+
if (actionName === "addColumn") {
24+
console.log(actionName, config)
25+
},
26+
// more actions
27+
});
28+
~~~
29+
30+
[The full list of the available actions is given below.](#list-of-actions)
31+
32+
>It means, that you don't have to constantly add sets of paired [**before-** and **after-**](api/overview/events_overview.md) events anymore to track and handle the actions which you execute when changing something in the spreadsheet.
33+
34+
>But if needed you can use an **old approach** because all the existing events will continue work as before:
35+
~~~js
36+
spreadsheet.events.on("afterColumnAdd", function(cell){
37+
console.log("A new column is added", cell);
38+
});
39+
~~~
40+
~~~js
41+
spreadsheet.events.on("beforeColumnAdd", function(cell){
42+
console.log("A new column will be added", cell);
43+
return true;
44+
});
45+
~~~
46+
47+
48+
49+
50+
## List of actions
51+
52+
| Action | Description |
53+
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
54+
| **addColumn** | The action is executed when you add a new column |
55+
| **addRow** | The action is executed when you add a new row |
56+
| **addSheet** | The action is executed when you add a new sheet |
57+
| **clear** | The action is executed when you clear the spreadsheet via the <b>clear()</b> method |
58+
| **clearSheet** | The action is executed when you clear a sheet via the <b>clearSheet()</b> method |
59+
| **deleteColumn** | The action is executed when you remove a column |
60+
| **deleteRow** | The action is executed when you remove a row |
61+
| **deleteSheet** | The action is executed when you remove a sheet |
62+
| **groupAction** | The action is executed when you select a range of cells and apply to them some actions (for instance, change the style or format of cells, lock/unlock the cells, clear cells' value or styles, etc.) |
63+
| **lockCell** | The action is executed when you lock/unlock a cell |
64+
| **removeCellStyles** | The action is executed when you clear styles of a cell |
65+
| **renameSheet** | The action is executed when you rename a sheet |
66+
| **resizeCol** | The action is executed when you resize a column |
67+
| **resizeRow** | The action is executed when you resize a row |
68+
| **setCellFormat** | The action is executed when you change the format of a cell |
69+
| **setCellValue** | The action is executed when you change or remove the value of a cell |
70+
| **setValidation** | The action is executed when you set data validation for a cell |
71+
| **sortCells** | The action is executed when you sort data in spreadsheet |
72+
| **setCellStyle** | The action is executed when you change the style of a cell |
73+
74+
**Related sample:** [Spreadsheet. Actions](https://snippet.dhtmlx.com/efcuxlkt)

docs/api/overview/events_overview.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ description: You can have an Events overview of the DHTMLX JavaScript Spreadshee
66

77
# Events overview
88

9-
| Name | Description |
10-
| :---------------------------------------------- | :----------------------------------------------------- |
9+
| Name | Description |
10+
| :--------------------------------------------- | :---------------------------------------------------- |
11+
| [](../spreadsheet_afteraction_event.md) | @getshort(../spreadsheet_afteraction_event.md) |
1112
| [](../spreadsheet_afterclear_event.md) | @getshort(../spreadsheet_afterclear_event.md) |
1213
| [](../spreadsheet_aftercolumnadd_event.md) | @getshort(../spreadsheet_aftercolumnadd_event.md) |
1314
| [](../spreadsheet_aftercolumndelete_event.md) | @getshort(../spreadsheet_aftercolumndelete_event.md) |
@@ -25,6 +26,7 @@ description: You can have an Events overview of the DHTMLX JavaScript Spreadshee
2526
| [](../spreadsheet_aftersheetrename_event.md) | @getshort(../spreadsheet_aftersheetrename_event.md) |
2627
| [](../spreadsheet_afterstylechange_event.md) | @getshort(../spreadsheet_afterstylechange_event.md) |
2728
| [](../spreadsheet_aftervaluechange_event.md) | @getshort(../spreadsheet_aftervaluechange_event.md) |
29+
| [](../spreadsheet_beforeaction_event.md) | @getshort(../spreadsheet_beforeaction_event.md) |
2830
| [](../spreadsheet_beforeclear_event.md) | @getshort(../spreadsheet_beforeclear_event.md) |
2931
| [](../spreadsheet_beforecolumnadd_event.md) | @getshort(../spreadsheet_beforecolumnadd_event.md) |
3032
| [](../spreadsheet_beforecolumndelete_event.md) | @getshort(../spreadsheet_beforecolumndelete_event.md) |

docs/api/overview/export_overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ description: You can have an Export methods overview of the DHTMLX JavaScript Sp
88

99
| Name | Description |
1010
| ----------------------------- | ------------------------------------ |
11+
| [](../export_json_method.md) | @getshort(../export_json_method.md) |
1112
| [](../export_xlsx_method.md) | @getshort(../export_xlsx_method.md) |

docs/api/overview/methods_overview.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ description: You can have a Methods overview of the DHTMLX JavaScript Spreadshee
66

77
# Methods overview
88

9-
| Name | Description |
10-
| :------------------------------------------- | :-------------------------------------------------- |
9+
| Name | Description |
10+
| :------------------------------------------ | :------------------------------------------------- |
1111
| [](../spreadsheet_addcolumn_method.md) | @getshort(../spreadsheet_addcolumn_method.md) |
1212
| [](../spreadsheet_addrow_method.md) | @getshort(../spreadsheet_addrow_method.md) |
1313
| [](../spreadsheet_addsheet_method.md) | @getshort(../spreadsheet_addsheet_method.md) |
@@ -33,6 +33,7 @@ description: You can have a Methods overview of the DHTMLX JavaScript Spreadshee
3333
| [](../spreadsheet_setactivesheet_method.md) | @getshort(../spreadsheet_setactivesheet_method.md) |
3434
| [](../spreadsheet_setformat_method.md) | @getshort(../spreadsheet_setformat_method.md) |
3535
| [](../spreadsheet_setstyle_method.md) | @getshort(../spreadsheet_setstyle_method.md) |
36+
| [](../spreadsheet_setvalidation_method.md) | @getshort(../spreadsheet_setvalidation_method.md) |
3637
| [](../spreadsheet_setvalue_method.md) | @getshort(../spreadsheet_setvalue_method.md) |
3738
| [](../spreadsheet_startedit_method.md) | @getshort(../spreadsheet_startedit_method.md) |
3839
| [](../spreadsheet_undo_method.md) | @getshort(../spreadsheet_undo_method.md) |

docs/api/overview/properties_overview.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ description: You can have a Properties overview of the DHTMLX JavaScript Spreads
66

77
# Properties overview
88

9-
| Name | Description |
10-
| ---------------------------------------------- | ----------------------------------------------------- |
9+
| Name | Description |
10+
| --------------------------------------------- | ---------------------------------------------------- |
1111
| [](../spreadsheet_colscount_config.md) | @getshort(../spreadsheet_colscount_config.md) |
1212
| [](../spreadsheet_dateformat_config.md) | @getshort(../spreadsheet_dateformat_config.md) |
1313
| [](../spreadsheet_editline_config.md) | @getshort(../spreadsheet_editline_config.md) |
@@ -19,4 +19,6 @@ description: You can have a Properties overview of the DHTMLX JavaScript Spreads
1919
| [](../spreadsheet_multisheets_config.md) | @getshort(../spreadsheet_multisheets_config.md) |
2020
| [](../spreadsheet_readonly_config.md) | @getshort(../spreadsheet_readonly_config.md) |
2121
| [](../spreadsheet_rowscount_config.md) | @getshort(../spreadsheet_rowscount_config.md) |
22+
| [](../spreadsheet_timeformat_config.md) | @getshort(../spreadsheet_timeformat_config.md) |
2223
| [](../spreadsheet_toolbarblocks_config.md) | @getshort(../spreadsheet_toolbarblocks_config.md) |
24+
| [](../spreadsheet_topsplit_config.md) | @getshort(../spreadsheet_topsplit_config.md) |
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
sidebar_label: afterAction
3+
title: afterAction event
4+
description: You can learn about the afterAction event in the documentation of the DHTMLX JavaScript Spreadsheet library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Spreadsheet.
5+
---
6+
7+
# afterAction
8+
9+
### Description
10+
11+
@short: Fires after an action is executed
12+
13+
### Usage
14+
15+
~~~jsx
16+
afterAction: (action: string, config: object) => void;
17+
~~~
18+
19+
### Parameters
20+
21+
The callback of the event takes the following parameters:
22+
23+
- `action` - (required) the name of the action. Check the full list of available actions [here](api/overview/actions_overview.md#list-of-actions)
24+
- `config` - (required) an object with parameters of the action
25+
26+
### Example
27+
28+
~~~jsx {6-11}
29+
const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
30+
// config parameters
31+
});
32+
spreadsheet.parse(dataset);
33+
34+
spreadsheet.events.on("afterAction", (actionName, config) => {
35+
if (actionName === "sortCells") {
36+
console.log(actionName, config);
37+
}
38+
});
39+
~~~
40+
41+
**Changelog:** Added in v4.3
42+
43+
**Related articles:**
44+
- [Spreadsheet actions](api/overview/actions_overview.md)
45+
- [Event handling](handling_events.md)

docs/api/spreadsheet_afterclear_event.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ description: You can learn about the afterClear event in the documentation of th
66

77
# afterClear
88

9+
:::caution
10+
The **afterClear** event has been deprecated in v4.3. The event will continue work, but you'd better apply a new approach:
11+
12+
~~~js
13+
spreadsheet.events.on("afterAction", (actionName, config) => {
14+
if (actionName === "clear") {
15+
console.log(actionName, config);
16+
}
17+
});
18+
~~~
19+
20+
For more details about the new concept, see **[Spreadsheet actions](api/overview/actions_overview.md)**.
21+
:::
22+
923
### Description
1024

1125
@short: Fires after a spreadsheet is cleared

docs/api/spreadsheet_aftercolumnadd_event.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ description: You can learn about the afterColumnAdd event in the documentation o
66

77
# afterColumnAdd
88

9+
:::caution
10+
The **afterColumnAdd** event has been deprecated in v4.3. The event will continue work, but you'd better apply a new approach:
11+
12+
~~~js
13+
spreadsheet.events.on("afterAction", (actionName, config) => {
14+
if (actionName === "addColumn") {
15+
console.log(actionName, config)
16+
}
17+
});
18+
~~~
19+
20+
For more details about the new concept, see **[Spreadsheet actions](api/overview/actions_overview.md)**.
21+
:::
22+
923
### Description
1024

1125
@short: Fires after a new column is added

0 commit comments

Comments
 (0)