Skip to content

Commit 1f19f31

Browse files
authored
Merge pull request #20 from DHTMLX/next
autowidth changed to required
2 parents 984bec2 + 4ed6355 commit 1f19f31

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

docs/api/config/columnshape-property.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ columnShape?: {
3535
- `width` - (optional) defines the width of a column; it's an object where each key is a field id and the value is the width of the column in pixels
3636
- `autoWidth` - (optional) an object that defines how column width should be calculated automatically. The default configuration uses 20 rows, and the width is calculated based on the header and data, with each field analyzed only once. The object parameters are the following:
3737
- `columns` - (optional) an object where each key is a field id and the boolean value defines whether column width should be calculated automatically
38-
- `auto` - (optional) if set to **header**, adjusts the width to the header text; if set to **data**, adjusts the width to the cell with the widest content; if set to **true**, the width is adjusted to the content of both headers and cell.
39-
Autowidth is not set by default (**false**) and the `width` value is set or the value of the `colWidth` from the [`tableShape`](/api/config/tableshape-property) property is applied.
38+
- `auto` - (required) if set to **header**, adjusts the width to the header text; if set to **data**, adjusts the width to the cell with the widest content; if set to **true**, the width is adjusted to the content of both headers and cell.
39+
If autowidth is set to **false**, the `width` value is set or the value of the `colWidth` from the [`tableShape`](/api/config/tableshape-property) property is applied.
4040
- `maxRows` - (optional) the number of rows to be processed for the autoWidth calculation
4141
- `firstOnly` - (optional) if set to **true** (default), each field of the same data is analyzed only once to calculate the column width; in case of multiple columns based on the same data (e.g., the *oil* field with the *count* operation and the *oil* field with the *sum* operation), only data in the first one will be analyzed and the others will inherit this width
4242

4343
## Example
4444

45-
~~~jsx {18-30}
45+
~~~jsx {18-31}
4646
const table = new pivot.Pivot("#root", {
4747
fields,
4848
data,
@@ -69,6 +69,7 @@ const table = new pivot.Pivot("#root", {
6969
title: true,
7070
score: true
7171
},
72+
auto: true,
7273
// analyze all fields
7374
firstOnly: false
7475
}

0 commit comments

Comments
 (0)