Skip to content

Commit 9baf651

Browse files
authored
Merge pull request #100 from DHTMLX/next
Update Grid adjust and autoHeight properties
2 parents 7500061 + 907595f commit 9baf651

3 files changed

Lines changed: 44 additions & 14 deletions

File tree

docs/grid/api/grid_adjust_config.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,31 @@ description: You can explore the adjust config of Grid in the documentation of t
88

99
@short: Optional. Defines whether the width of columns is automatically adjusted to the width of their content
1010

11-
@signature: {'adjust?: "header" | "footer" | "data" | boolean;'}
11+
#### Usage
12+
13+
~~~ts
14+
adjust?: "header" | "footer" | "data" | boolean;
15+
~~~
1216

1317
@default: false
1418

15-
@example:
19+
@descr:
20+
21+
:::info
22+
You can't enable `autoHeight` and `adjust` properties at the same time, as they are mutually exclusive.
23+
:::
24+
25+
#### Example
26+
27+
~~~jsx
1628
const grid = new dhx.Grid("grid_container", {
1729
columns: [
1830
// columns config
1931
],
2032
adjust: true,
2133
data: dataset
2234
});
23-
24-
@descr:
35+
~~~
2536

2637
**Related sample**: [Grid. Adjust columns by header, data, all](https://snippet.dhtmlx.com/zfrpe22d)
2738

@@ -52,14 +63,15 @@ The `adjust` property has a priority over the [`autoWidth`](../../../grid/config
5263

5364
The width the columns will be adjusted to also depends on the values of the [`minWidth/maxWidth`](../../../grid/api/api_gridcolumn_properties/) properties if they are set for a column.
5465

55-
**Note** that:
66+
#### Take into account the information below:
5667

5768
- to optimize performance, you should specify `htmlEnable: true` in the configuration object of the column which contains HTML content
5869
- you can also specify `htmlEnable:true` in the configuration object of Grid
5970
- `htmlEnable: true` allows calculating the content of simple HTML templates by excluding HTML markup and calculating internal content
6071
- in case of complex HTML data, usage of the `adjust` config may lead to incorrect size calculations
6172
- the enabled `adjust` config (including the "header", "footer", "data" modes) adjusts the width of columns taking into account the [`template`](grid/api/api_gridcolumn_properties.md) added to cells. You need to set the **content** attribute of the [`header/footer`](grid/api/api_gridcolumn_properties.md) properties to one of the following modes: "avg" | "sum" | "max" | "min" | "count", otherwise **text** will be calculated
6273

74+
6375
**Related API**: [`adjustColumnWidth()`](grid/api/grid_adjustcolumnwidth_method.md)
6476

6577
**Related article**: [Autosize for columns](grid/configuration.md#autosize-for-columns)

docs/grid/api/grid_autoheight_config.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,31 @@ This functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) pac
1212

1313
@short: Optional. Makes long text split into multiple lines based on the width of the column, controls the automatic height adjustment of the header/footer and cells with data
1414

15-
@signature: {'autoHeight?: boolean;'}
15+
#### Usage
16+
17+
~~~ts
18+
autoHeight?: boolean;
19+
~~~
1620

1721
@default: false
1822

19-
@example:
23+
@descr:
24+
25+
:::info
26+
You can't enable `autoHeight` and `adjust` properties at the same time, as they are mutually exclusive.
27+
:::
28+
29+
#### Example
30+
31+
~~~jsx
2032
const grid = new dhx.Grid("grid_container", {
2133
columns: [
2234
// columns config
2335
],
2436
autoHeight: true,
2537
data: dataset
2638
});
27-
28-
@descr:
39+
~~~
2940

3041
**Related sample**: [Grid. Rows auto height](https://snippet.dhtmlx.com/zkcsyazg)
3142

@@ -51,6 +62,7 @@ const grid = new dhx.Grid("grid_container", {
5162
- in case of complex HTML data, usage of the `autoHeight` config may lead to incorrect size calculations
5263
- note that if you decide to change the font type, its size and offsets, correct calculation of the cell's autoHeight can't be ensured
5364

65+
5466
@changelog: added in v7.1
5567

5668
[comment]: # (@relatedapi: grid/api/grid_data_config.md)

docs/grid/api/gridcolumn_properties/gridcolumn_adjust_property.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@ description: You can explore the adjust config of Grid column in the documentati
88

99
@short: Optional. Defines whether the width of a column is automatically adjusted to its content
1010

11-
### Usage
11+
#### Usage
1212

13-
~~~jsx
13+
~~~ts
1414
adjust?: "data" | "header" | "footer" | boolean;
1515
~~~
1616

1717
@default: false
1818

1919
@descr:
20-
### Example
20+
:::info
21+
You can't enable `autoHeight` and `adjust` properties at the same time, as they are mutually exclusive.
22+
:::
23+
24+
#### Example
2125

2226
~~~jsx
2327
const grid = new dhx.Grid("grid_container", {
@@ -30,8 +34,10 @@ const grid = new dhx.Grid("grid_container", {
3034
});
3135
~~~
3236

33-
- The `adjust` property has a priority over the `autoWidth` property if it is specified either for the grid or for the column, and over the `width` property of the column.
34-
- The width the columns will be adjusted to also depends on the values of the `minWidth/maxWidth` properties if they are set for a column.
37+
#### Take into account the information below:
38+
39+
- the `adjust` property has a priority over the `autoWidth` property if it is specified either for the grid or for the column, and over the `width` property of the column
40+
- the width the columns will be adjusted to also depends on the values of the `minWidth/maxWidth` properties if they are set for a column
3541

3642
:::note
3743
Note that if you change the font type, size, or offsets, the correct calculation of the `adjust` property of a cell may not be guaranteed.

0 commit comments

Comments
 (0)