Skip to content

Commit 3319fc1

Browse files
authored
Merge pull request #18 from DHTMLX/toolbar-restructuring-4915
[update] toolbar-related docs
2 parents 5ddf272 + 151c1fd commit 3319fc1

File tree

4 files changed

+52
-44
lines changed

4 files changed

+52
-44
lines changed

docs/api/spreadsheet_toolbarblocks_config.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,47 +19,47 @@ toolbarBlocks?: array;
1919
### Default config
2020

2121
~~~jsx
22-
toolbarBlocks: ["undo", "colors", "decoration", "align", "format", "actions", "helpers"]
22+
toolbarBlocks: ["undo", "colors", "decoration", "align", "cell", "format", "actions"]
2323
~~~
2424

2525
### Example
2626

2727
~~~jsx {3-15}
28-
const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
28+
const spreadsheet = new dhx.Spreadsheet("spreadsheet_container", {
2929
// full toolbar
3030
toolbarBlocks: [
3131
"undo",
3232
"colors",
3333
"decoration",
3434
"align",
35+
"cell",
36+
"format",
37+
"actions",
3538
"lock",
3639
"clear",
37-
"rows",
3840
"columns",
39-
"helpers",
40-
"format",
41-
"file"
41+
"rows",
42+
"file",
43+
"help"
4244
]
4345
});
4446
~~~
4547

4648
### Details
4749

48-
You can specify your own structure of the toolbar by enumerating necessary elements in the **toolbarBlocks** array in the desired order, for example:
50+
You can specify your own structure of the toolbar by enumerating necessary elements in the `toolbarBlocks` array in the desired order, for example:
4951

50-
~~~jsx {2}
51-
const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
52-
toolbarBlocks: ["helpers", "colors", "align", "decoration", "lock", "clear"]
52+
~~~jsx
53+
const spreadsheet = new dhx.Spreadsheet("spreadsheet_container", {
54+
toolbarBlocks: ["colors", "align", "cell", "decoration", "lock", "clear"]
5355
});
5456
~~~
5557

56-
![Custom toolbar](../assets/custom_toolbar.png)
57-
5858
Check how you can [customize the toolbar](customization.md/#toolbar).
5959

6060
**Change log:**
61-
- The *"actions"* block was added in v5.0
62-
- The *"help"* block was renamed to *"helpers"* in v5.0
61+
- The *"actions"* block is added in v5.0
62+
- The *"cell"* block is added in v5.2
6363

6464
**Related articles:**
6565
- [Configuration](configuration.md#toolbar)

docs/configuration.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ You can adjust the desired settings of DHTMLX Spreadsheet to meet your needs. Th
1010

1111
## Toolbar
1212

13-
The toolbar of the Spreadsheet consists of several blocks of controls that can be changed according to your needs. By default, there are the following blocks of controls in the toolbar: "undo", "colors", "decoration", "align", "format", "actions", "helpers". You can add more blocks from the list: "lock", "clear", "rows", "columns", "file".
13+
The toolbar of the Spreadsheet consists of several blocks of controls that can be changed according to your needs. By default, there are the following blocks of controls in the toolbar: "undo", "colors", "decoration", "align", "cell", "format", "actions". You can add more blocks from the list: "lock", "clear", "rows", "columns", "file", "help".
1414

1515
<iframe src="https://snippet.dhtmlx.com/kpm017nx?mode=js" frameborder="0" class="snippet_iframe" width="100%" height="450"></iframe>
1616

1717
The structure of toolbar can be adjusted via the [](api/spreadsheet_toolbarblocks_config.md) configuration option of the component, which is an array with strings presenting the names of controls.
1818

19-
You can also specify your own structure of the toolbar by enumerating necessary elements in the **toolbarBlocks** array in the desired order, for example: "helpers", "colors", "align", "decoration", "lock", "clear".
19+
You can also specify your own structure of the toolbar by enumerating necessary elements in the **toolbarBlocks** array in the desired order, for example: "colors", "align", "cell", "decoration", "lock", "clear".
20+
21+
~~~jsx
22+
const spreadsheet = new dhx.Spreadsheet("spreadsheet_container", {
23+
toolbarBlocks: ["colors", "align", "cell", "decoration", "lock", "clear"]
24+
});
25+
~~~
2026

2127
Toolbar is [highly customizable](customization.md). You can add new controls, change the icons of controls and apply the desired icon pack.
2228

docs/customization.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,16 @@ spreadsheet.toolbar.data.remove("control-id");
115115
The [default toolbar](/#toolbar) contains the following blocks of controls:
116116

117117
- the **Undo** block
118-
- the *Undo* button (id:"undo")
119-
- the *Redo* button (id:"redo")
118+
- the *Undo* button (id: "undo")
119+
- the *Redo* button (id: "redo")
120120
- the **Colors** block
121-
- the *Text color* button (id:"color")
122-
- the *Background color* button (id:"background")
121+
- the *Text color* button (id: "color")
122+
- the *Background color* button (id: "background")
123123
- the **Decoration** block
124-
- the *Bold* button (id:"font-weight-bold")
125-
- the *Italic* button (id:"font-style-italic")
126-
- the *Underline* button (id:"text-decoration-underline")
127-
- the *Strikethrough* button (id:"text-decoration-line-through")
124+
- the *Bold* button (id: "font-weight-bold")
125+
- the *Italic* button (id: "font-style-italic")
126+
- the *Underline* button (id: "text-decoration-underline")
127+
- the *Strikethrough* button (id: "text-decoration-line-through")
128128
- the **Align** block
129129
- the **Horizontal align** sub-block
130130
- the *Left* button (id: "halign-left")
@@ -137,35 +137,37 @@ The [default toolbar](/#toolbar) contains the following blocks of controls:
137137
- the **Text wrapping** sub-block
138138
- the *Clip* button (id: "multiline-clip")
139139
- the *Wrap* button (id: "multiline-wrap")
140-
- the **Merge/Unmerge** button (id: "merge")
140+
- the **Cell** block
141+
- the *Border* button (id: "border")
142+
- the *Merge/Unmerge* button (id: "merge")
141143
- the **Format** block
142-
- the *Format* menuItem (id:"format")
144+
- the *Format* menuItem (id: "format")
143145
- the **Actions** block
144-
- the *Filter* button (id:"filter")
145-
- the **Helpers** block
146-
- the *Link* button (id:"link")
147-
- the *Help* button (id:"help")
146+
- the *Filter* button (id: "filter")
147+
- the *Insert link* button (id: "link")
148148

149149
It is also possible to add the blocks enumerated below:
150150

151151
- the **Lock** block
152-
- the *Lock* button (id:"lock")
152+
- the *Lock* button (id: "lock")
153153
- the **Clear** block
154-
- the *Clear group* menuItem (id:"clear-group")
155-
- the *Clear value* menuItem (id:"clear-value")
156-
- the *Clear styles* menuItem (id:"clear-styles")
157-
- the *Clear all* menuItem (id:"clear-all")
154+
- the *Clear group* menuItem (id: "clear-group")
155+
- the *Clear value* menuItem (id: "clear-value")
156+
- the *Clear styles* menuItem (id: "clear-styles")
157+
- the *Clear all* menuItem (id: "clear-all")
158158
- the **Rows** block
159-
- the *Add row* button (id:"add-row")
160-
- the *Remove row* button (id:"remove-row")
159+
- the *Add row* button (id: "add-row")
160+
- the *Remove row* button (id: "remove-row")
161161
- the **Columns** block
162-
- the *Add column* button (id:"add-col")
163-
- the *Remove column* button (id:"remove-col")
162+
- the *Add column* button (id: "add-col")
163+
- the *Remove column* button (id: "remove-col")
164164
- the **File** block
165-
- the *Export* menuItem (id:"export")
166-
- the *"Microsoft Excel(.xlsx)"* menuItem (id:"export-xlsx")
167-
- the *Import* menuItem (id:"import")
168-
- the *"Microsoft Excel(.xlsx)"* menuItem (id:"import-xlsx")
165+
- the *Export* menuItem (id: "export")
166+
- the *"Microsoft Excel(.xlsx)"* menuItem (id: "export-xlsx")
167+
- the *Import* menuItem (id: "import")
168+
- the *"Microsoft Excel(.xlsx)"* menuItem (id: "import-xlsx")
169+
- the **Help** block
170+
- the *Help* button (id: "help")
169171

170172
### Adding controls
171173

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ There is a [User Guide](guides/#user-guides) provided to make work with Spreadsh
1717

1818
### Toolbar
1919

20-
The **Toolbar** section is rather flexible. It contains 6 default blocks of controls: "undo", "colors", "decoration", "align", "format", "actions", "helpers". You can [change the toolbar structure](configuration.md#toolbar) and add more blocks, or change the order of the blocks.
20+
The **Toolbar** section is rather flexible. It contains several default blocks of controls: "undo", "colors", "decoration", "align", "cell", "format", "actions". You can [change the toolbar structure](configuration.md#toolbar) and add more blocks, or set your own order of the blocks.
2121

2222
![Spreadsheet Toolbar](assets/overview_toolbar.png)
2323

0 commit comments

Comments
 (0)