Skip to content

Commit 98b10f2

Browse files
authored
Merge pull request #19 from DHTMLX/freezing-columns-and-rows-3667
[add] docs on freezing/unfreezing rows and columns functionality
2 parents 3319fc1 + 83f2281 commit 98b10f2

27 files changed

+296
-97
lines changed

docs/api/api_overview.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Parameters:
3434
| [](api/spreadsheet_eachcell_method.md) | @getshort(api/spreadsheet_eachcell_method.md) |
3535
| [](api/spreadsheet_endedit_method.md) | @getshort(api/spreadsheet_endedit_method.md) |
3636
| [](api/spreadsheet_fitcolumn_method.md) | @getshort(api/spreadsheet_fitcolumn_method.md) |
37+
| [](api/spreadsheet_freezecols_method.md) | @getshort(api/spreadsheet_freezecols_method.md) |
38+
| [](api/spreadsheet_freezerows_method.md) | @getshort(api/spreadsheet_freezerows_method.md) |
3739
| [](api/spreadsheet_getactivesheet_method.md) | @getshort(api/spreadsheet_getactivesheet_method.md) |
3840
| [](api/spreadsheet_getfilter_method.md) | @getshort(api/spreadsheet_getfilter_method.md) |
3941
| [](api/spreadsheet_getformat_method.md) | @getshort(api/spreadsheet_getformat_method.md) |
@@ -60,6 +62,8 @@ Parameters:
6062
| [](api/spreadsheet_setvalue_method.md) | @getshort(api/spreadsheet_setvalue_method.md) |
6163
| [](api/spreadsheet_startedit_method.md) | @getshort(api/spreadsheet_startedit_method.md) |
6264
| [](api/spreadsheet_undo_method.md) | @getshort(api/spreadsheet_undo_method.md) |
65+
| [](api/spreadsheet_unfreezecols_method.md) | @getshort(api/spreadsheet_unfreezecols_method.md) |
66+
| [](api/spreadsheet_unfreezerows_method.md) | @getshort(api/spreadsheet_unfreezerows_method.md) |
6367
| [](api/spreadsheet_unlock_method.md) | @getshort(api/spreadsheet_unlock_method.md) |
6468

6569
## Spreadsheet events
@@ -114,15 +118,14 @@ Parameters:
114118
| [](api/spreadsheet_exportmodulepath_config.md) | @getshort(api/spreadsheet_exportmodulepath_config.md) |
115119
| [](api/spreadsheet_formats_config.md) | @getshort(api/spreadsheet_formats_config.md) |
116120
| [](api/spreadsheet_importmodulepath_config.md) | @getshort(api/spreadsheet_importmodulepath_config.md) |
117-
| [](api/spreadsheet_leftsplit_config.md) | @getshort(api/spreadsheet_leftsplit_config.md) |
118121
| [](api/spreadsheet_localization_config.md) | @getshort(api/spreadsheet_localization_config.md) |
119122
| [](api/spreadsheet_menu_config.md) | @getshort(api/spreadsheet_menu_config.md) |
120123
| [](api/spreadsheet_multisheets_config.md) | @getshort(api/spreadsheet_multisheets_config.md) |
121124
| [](api/spreadsheet_readonly_config.md) | @getshort(api/spreadsheet_readonly_config.md) |
122125
| [](api/spreadsheet_rowscount_config.md) | @getshort(api/spreadsheet_rowscount_config.md) |
123126
| [](api/spreadsheet_timeformat_config.md) | @getshort(api/spreadsheet_timeformat_config.md) |
124127
| [](api/spreadsheet_toolbarblocks_config.md) | @getshort(api/spreadsheet_toolbarblocks_config.md) |
125-
| [](api/spreadsheet_topsplit_config.md) | @getshort(api/spreadsheet_topsplit_config.md) |
128+
126129

127130
## Selection methods
128131

docs/api/overview/actions_overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ spreadsheet.events.on("beforeColumnAdd", function(cell){
7474
| **setValidation** | The action is executed when setting data validation for a cell |
7575
| **sortCells** | The action is executed when sorting data in spreadsheet |
7676
| **setCellStyle** | The action is executed when changing the style of a cell |
77+
| **toggleFreeze** | The action is executed when freezing/unfreezing columns/rows |
7778
| **unmerge** | The action is executed when splitting cells |
7879

7980
**Change log:**
8081

82+
- The **toggleFreeze** action was added in v5.2
8183
- The **merge**, **unmerge**, **filter**, **fitColumn**, **insertLink** actions were added in v5.0
8284

8385
**Related sample:** [Spreadsheet. Actions](https://snippet.dhtmlx.com/efcuxlkt)

docs/api/overview/methods_overview.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ description: You can have a Methods overview of the DHTMLX JavaScript Spreadshee
1818
| [](../spreadsheet_eachcell_method.md) | @getshort(../spreadsheet_eachcell_method.md) |
1919
| [](../spreadsheet_endedit_method.md) | @getshort(../spreadsheet_endedit_method.md) |
2020
| [](../spreadsheet_fitcolumn_method.md) | @getshort(../spreadsheet_fitcolumn_method.md) |
21+
| [](../spreadsheet_freezecols_method.md) | @getshort(../spreadsheet_freezecols_method.md) |
22+
| [](../spreadsheet_freezerows_method.md) | @getshort(../spreadsheet_freezerows_method.md) |
2123
| [](../spreadsheet_getactivesheet_method.md) | @getshort(../spreadsheet_getactivesheet_method.md) |
2224
| [](../spreadsheet_getfilter_method.md) | @getshort(../spreadsheet_getfilter_method.md) |
2325
| [](../spreadsheet_getformat_method.md) | @getshort(../spreadsheet_getformat_method.md) |
@@ -44,4 +46,6 @@ description: You can have a Methods overview of the DHTMLX JavaScript Spreadshee
4446
| [](../spreadsheet_setvalue_method.md) | @getshort(../spreadsheet_setvalue_method.md) |
4547
| [](../spreadsheet_startedit_method.md) | @getshort(../spreadsheet_startedit_method.md) |
4648
| [](../spreadsheet_undo_method.md) | @getshort(../spreadsheet_undo_method.md) |
49+
| [](../spreadsheet_unfreezecols_method.md) | @getshort(../spreadsheet_unfreezecols_method.md) |
50+
| [](../spreadsheet_unfreezerows_method.md) | @getshort(../spreadsheet_unfreezerows_method.md) |
4751
| [](../spreadsheet_unlock_method.md) | @getshort(../spreadsheet_unlock_method.md) |

docs/api/overview/properties_overview.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ description: You can have a Properties overview of the DHTMLX JavaScript Spreads
1414
| [](../spreadsheet_exportmodulepath_config.md) | @getshort(../spreadsheet_exportmodulepath_config.md) |
1515
| [](../spreadsheet_formats_config.md) | @getshort(../spreadsheet_formats_config.md) |
1616
| [](../spreadsheet_importmodulepath_config.md) | @getshort(../spreadsheet_importmodulepath_config.md) |
17-
| [](../spreadsheet_leftsplit_config.md) | @getshort(../spreadsheet_leftsplit_config.md) |
1817
| [](../spreadsheet_localization_config.md) | @getshort(../spreadsheet_localization_config.md) |
1918
| [](../spreadsheet_menu_config.md) | @getshort(../spreadsheet_menu_config.md) |
2019
| [](../spreadsheet_multisheets_config.md) | @getshort(../spreadsheet_multisheets_config.md) |
2120
| [](../spreadsheet_readonly_config.md) | @getshort(../spreadsheet_readonly_config.md) |
2221
| [](../spreadsheet_rowscount_config.md) | @getshort(../spreadsheet_rowscount_config.md) |
2322
| [](../spreadsheet_timeformat_config.md) | @getshort(../spreadsheet_timeformat_config.md) |
2423
| [](../spreadsheet_toolbarblocks_config.md) | @getshort(../spreadsheet_toolbarblocks_config.md) |
25-
| [](../spreadsheet_topsplit_config.md) | @getshort(../spreadsheet_topsplit_config.md) |
24+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
sidebar_label: freezeCols()
3+
title: freezeCols method
4+
description: You can learn about the freezeCols 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+
# freezeCols()
8+
9+
### Description
10+
11+
@short: Fixes ("freezes") columns
12+
13+
### Usage
14+
15+
~~~jsx
16+
freezeCols(cell?: string): void;
17+
~~~
18+
19+
### Parameters
20+
21+
- `cell` - (optional) the id of the cell used to define the id of a column. If the cell id isn't passed, the currently selected cell will be used
22+
23+
### Example
24+
25+
~~~jsx
26+
spreadsheet.freezeCols("B2"); // the columns up to the "B" column will be fixed
27+
spreadsheet.freezeCols("sheet2!B2"); // the columns up to the "B" column in "sheet2" will be fixed
28+
~~~
29+
30+
**Related articles:** [Work with Spreadsheet](working_with_ssheet.md/#freezingunfreezing-rows-and-columns)
31+
32+
**Related API:** [`unfreezeCols()`](api/spreadsheet_unfreezecols_method.md/)
33+
34+
**Related sample:** [Spreadsheet. Freezing columns and rows via API](https://snippet.dhtmlx.com/a12xd1mn)
35+
36+
**Change log:**
37+
Added in v5.2
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
sidebar_label: freezeRows()
3+
title: freezeRows method
4+
description: You can learn about the freezeRows 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+
# freezeRows()
8+
9+
### Description
10+
11+
@short: Fixes ("freezes") rows
12+
13+
### Usage
14+
15+
~~~jsx
16+
freezeRows(cell?: string): void;
17+
~~~
18+
19+
### Parameters
20+
21+
- `cell` - (optional) the id of the cell used to define the id of a row. If the cell id isn't passed, the currently selected cell will be used
22+
23+
### Example
24+
25+
~~~jsx
26+
spreadsheet.freezeRows("B2"); // the rows up to the second row will be fixed
27+
spreadsheet.freezeRows("sheet2!B2"); // the rows up to the second row in "sheet2" will be fixed
28+
~~~
29+
30+
**Related articles:** [Work with Spreadsheet](working_with_ssheet.md/#freezingunfreezing-rows-and-columns)
31+
32+
**Related API:** [`unfreezeRows()`](api/spreadsheet_unfreezerows_method.md/)
33+
34+
**Related sample:** [Spreadsheet. Freezing columns and rows via API](https://snippet.dhtmlx.com/a12xd1mn)
35+
36+
**Change log:**
37+
Added in v5.2

docs/api/spreadsheet_leftsplit_config.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/api/spreadsheet_parse_method.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ parse({
6565
to: { column: index, row: index }
6666
},
6767
// more objects
68-
]
68+
],
69+
freeze?: {
70+
col?: number,
71+
row?: number,
72+
}
6973
},
7074
// more sheet objects
7175
]
@@ -116,6 +120,10 @@ If you need to create a data set *for several sheets* at once, specify data as a
116120
- `to` - an object which defines the position of the last cell from a range:
117121
- `column` - the index of the column
118122
- `row` - the index of the row
123+
- `freeze` - (optional) an object that sets and adjusts fixed columns/rows for particular sheets. It may contain the following properties:
124+
- `col` - (optional) specifies the number of fixed columns, for example, 2
125+
- `row` - (optional) specifies the number of fixed rows, for example, 2
126+
The default value of the parameter is `freeze: {col: 0, row: 0}`
119127

120128
:::info
121129
In case the [`multisheets`](api/spreadsheet_multisheets_config.md) configuration option is set to *false*, only one sheet will be created.

docs/api/spreadsheet_topsplit_config.md

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
sidebar_label: unfreezeCols()
3+
title: unfreezeCols method
4+
description: You can learn about the unfreezeCols 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+
# unfreezeCols()
8+
9+
### Description
10+
11+
@short: Unfreezes the fixed ("frozen") columns
12+
13+
### Usage
14+
15+
~~~jsx
16+
unfreezeCols(cell?: string): void;
17+
~~~
18+
19+
### Parameters
20+
21+
- `cell` - (optional) the id of the cell used to define the id of a column. If the cell id isn't passed, the currently selected cell will be used
22+
23+
### Example
24+
25+
~~~jsx
26+
spreadsheet.unfreezeCols(); // fixed columns in the current sheet will be unfrozen
27+
spreadsheet.unfreezeCols("sheet2!A1"); // fixed columns in "sheet2" will be unfrozen
28+
~~~
29+
30+
**Related articles:** [Work with Spreadsheet](working_with_ssheet.md/#freezingunfreezing-rows-and-columns)
31+
32+
**Related API:** [`freezeCols()`](api/spreadsheet_freezecols_method.md/)
33+
34+
**Related sample:** [Spreadsheet. Freezing columns and rows via API](https://snippet.dhtmlx.com/a12xd1mn)
35+
36+
**Change log:**
37+
Added in v5.2

0 commit comments

Comments
 (0)