Skip to content

Commit 38177cc

Browse files
committed
[update] correct and complete docs for v5.2
1 parent dfdd62e commit 38177cc

File tree

3 files changed

+60
-2
lines changed

3 files changed

+60
-2
lines changed

docs/api/spreadsheet_afterdataloaded_event.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ description: You can learn about the afterDataLoaded event in the documentation
1313
### Usage
1414

1515
~~~jsx
16-
afterColumnAdd: (cell: string) => void;
16+
afterDataLoaded: () => void;
1717
~~~
1818

1919
### Example

docs/migration.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ description: You can learn about migration in the documentation of the DHTMLX Ja
1313
In v5.2 the way of freezing/unfreezing columns and rows has been modified:
1414

1515
- the `leftSplit` and `topSplit` configuration properties that have been used for fixing columns and rows were deprecated
16-
- new API methods `freezeCols()`, `unfreezeCols()`, `freezeRows()`, `unfreezeRows()` and a new action `toggleFreeze` were introduced
1716

1817
~~~jsx title="Before v5.2"
1918
const spreadsheet = new dhx.Spreadsheet("spreadsheet_container", {
@@ -22,6 +21,8 @@ const spreadsheet = new dhx.Spreadsheet("spreadsheet_container", {
2221
});
2322
~~~
2423

24+
- new API methods were introduced: [`freezeCols()`](api/spreadsheet_freezecols_method.md), [`unfreezeCols()`](api/spreadsheet_unfreezecols_method.md), [`freezeRows()`](api/spreadsheet_freezerows_method.md), [`unfreezeRows()`](api/spreadsheet_unfreezerows_method.md)
25+
2526
~~~jsx title="From v5.2"
2627
// for rows
2728
spreadsheet.freezeRows("B2"); // the rows up to the second row will be fixed
@@ -34,7 +35,11 @@ spreadsheet.freezeCols("B2"); // the columns up to the "B" column will be fixed
3435
spreadsheet.freezeCols("sheet2!B2"); // the columns up to the "B" column in "sheet2" will be fixed
3536
spreadsheet.unfreezeCols(); // fixed columns in the current sheet will be unfrozen
3637
spreadsheet.unfreezeCols("sheet2!A1"); // fixed columns in "sheet2" will be unfrozen
38+
~~~
39+
40+
- new action was added: [`toggleFreeze`](api/overview/actions_overview.md/#list-of-actions)
3741

42+
~~~jsx title="From v5.2"
3843
// using the `toggleFreeze` action with the beforeAction/afterAction events
3944
spreadsheet.events.on("afterAction", (actionName, config) => {
4045
if (actionName === "toggleFreeze") {
@@ -49,6 +54,31 @@ spreadsheet.events.on("beforeAction", (actionName, config) => {
4954
});
5055
~~~
5156

57+
- new `freeze` property for the *sheets* object of the [`parse()`](api/spreadsheet_parse_method.md) method was added. It allows fixing rows and columns for particular sheets in the dataset, while parsing data into Spreadsheet:
58+
59+
~~~jsx {10-13} title="From v5.2"
60+
const data = {
61+
sheets : [
62+
{
63+
name: "sheet 1",
64+
id: "sheet_1",
65+
data: [
66+
{ cell: "A1", value: "Country" },
67+
{ cell: "B1", value: "Product" }
68+
],
69+
freeze: {
70+
col: 2,
71+
row: 2
72+
},
73+
// more sheet settings
74+
},
75+
// more sheets configuration objects
76+
]
77+
};
78+
79+
spreadsheet.parse(data);
80+
~~~
81+
5282
## 4.3 -> 5.0
5383

5484
In v5.0, the *"help"* option of the [toolbarBlocks](api/spreadsheet_toolbarblocks_config.md) property is renamed to *"helpers"*. Besides, the default set of options is extended by the new *"actions"* option.

docs/working_with_ssheet.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,34 @@ spreadsheet.unfreezeRows(); // fixed rows in the current sheet will be unfrozen
111111
spreadsheet.unfreezeRows("sheet2!A1"); // fixed rows in "sheet2" will be unfrozen
112112
~~~
113113

114+
### Freezing rows/columns in the dataset
115+
116+
You can also fix rows and columns for particular sheets in the dataset, while parsing data into Spreadsheet.
117+
For this, use the `freeze` property in the *sheets* object of the [`parse()`](api/spreadsheet_parse_method.md) method:
118+
119+
~~~jsx {10-13}
120+
const data = {
121+
sheets : [
122+
{
123+
name: "sheet 1",
124+
id: "sheet_1",
125+
data: [
126+
{ cell: "A1", value: "Country" },
127+
{ cell: "B1", value: "Product" }
128+
],
129+
freeze: {
130+
col: 2,
131+
row: 2
132+
},
133+
// more sheet settings
134+
},
135+
// more sheets configuration objects
136+
]
137+
};
138+
139+
spreadsheet.parse(data);
140+
~~~
141+
114142
## Hiding/showing rows and columns
115143

116144
You can hide and show particular rows and columns via the corresponding API methods.

0 commit comments

Comments
 (0)