Skip to content

Commit f9f23f2

Browse files
committed
[update] what's new for v5.2, add a draft for migration guide
1 parent d6856e1 commit f9f23f2

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

docs/migration.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,83 @@ description: You can learn about migration in the documentation of the DHTMLX Ja
66

77
# Migration to newer versions
88

9+
## 5.1 -> 5.2
10+
11+
### toolbarBlocks
12+
13+
In v5.2 the [toolbarBlocks](api/spreadsheet_toolbarblocks_config.md) property is modified in the following way:
14+
15+
- the default set of toolbar options is extended by the new *"cell"* option. It includes the *Border* button and the *Merge* button (previously, it was in the *"align"* block)
16+
- the *"actions"* toolbar block is extended with the *Insert link* button (previously, it was in the *"helpers"* block)
17+
- the *"helpers"* toolbar block is renamed to *"help"* and isn't included in the default set of toolbar options
18+
19+
~~~jsx title="Before v5.2" {9}
20+
// default configuration
21+
toolbarBlocks: [
22+
"undo",
23+
"colors",
24+
"decoration",
25+
"align",
26+
"format",
27+
"actions",
28+
"helpers"
29+
]
30+
~~~
31+
32+
~~~jsx title="From v5.2" {7}
33+
// default configuration
34+
toolbarBlocks: [
35+
"undo",
36+
"colors",
37+
"decoration",
38+
"align",
39+
"cell",
40+
"format",
41+
"actions"
42+
]
43+
~~~
44+
45+
### Freezing/unfreezing functionality
46+
47+
In v5.2 the way of freezing/unfreezing columns and rows has been modified:
48+
49+
- the `leftSplit` and `topSplit` configuration properties that have been used for fixing columns and rows were deprecated
50+
- new API methods `freezeCols()`, `unfreezeCols()`, `freezeRows()`, `unfreezeRows()` and a new action `toggleFreeze` were introduced
51+
52+
~~~jsx title="Before v5.0"
53+
const spreadsheet = new dhx.Spreadsheet("spreadsheet_container", {
54+
topSplit: 1, // the number of row to "freeze"
55+
leftSplit: 1 // the number of columns to "freeze"
56+
});
57+
~~~
58+
59+
~~~jsx title="From v5.0"
60+
// for rows
61+
spreadsheet.freezeRows("B2"); // the rows up to the second row will be fixed
62+
spreadsheet.freezeRows("sheet2!B2"); // the rows up to the second row in "sheet2" will be fixed
63+
spreadsheet.unfreezeRows(); // fixed rows in the current sheet will be unfrozen
64+
spreadsheet.unfreezeRows("sheet2!A1"); // fixed rows in "sheet2" will be unfrozen
65+
66+
// for columns
67+
spreadsheet.freezeCols("B2"); // the columns up to the "B" column will be fixed
68+
spreadsheet.freezeCols("sheet2!B2"); // the columns up to the "B" column in "sheet2" will be fixed
69+
spreadsheet.unfreezeCols(); // fixed columns in the current sheet will be unfrozen
70+
spreadsheet.unfreezeCols("sheet2!A1"); // fixed columns in "sheet2" will be unfrozen
71+
72+
// using the `toggleFreeze` action with the beforeAction/afterAction events
73+
spreadsheet.events.on("afterAction", (actionName, config) => {
74+
if (actionName === "toggleFreeze") {
75+
console.log(actionName, config);
76+
}
77+
});
78+
79+
spreadsheet.events.on("beforeAction", (actionName, config) => {
80+
if (actionName === "toggleFreeze") {
81+
console.log(actionName, config);
82+
}
83+
});
84+
~~~
85+
986
## 4.3 -> 5.0
1087

1188
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/whats_new.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ The new release introduces some changes to the `toolbarBlocks` property and the
3131
- the ability to freeze/unfreeze columns and rows via API
3232
- new methods: `freezeCols()`, `unfreezeCols()`, `freezeRows()`, `unfreezeRows()`
3333
- new action: `toggleFreeze`
34+
- new `freeze` property for the *sheets* object of the `parse()` method
3435
- Hiding/showing columns/rows:
3536
- the ability to hide/show columns and rows via UI
3637
- the ability to hide/show columns and rows via API
3738
- new methods: `hideCols()`, `showCols()`, `hideRows()`, `showRows()`
3839
- new action: `toggleVisibility`
40+
- new `hidden` property for the *cols* and *rows* configs of the *sheets* object of the `parse()` method
3941
- Working with formulas:
4042
- a popup with descriptions for formulas is added
4143
- a new locale: `formulas` is added

0 commit comments

Comments
 (0)