You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`templates` - (optional) allows setting templates to a cell; it's an object where:
49
49
- each key is a field id
50
-
- the value is a function that returns a string and receives cell value and operation
51
-
All columns based on the specified field will have the related template applied. For example, it allows setting the units of measurement or returning the required number of digits after the decimal point for numeric values, etc. See the example below.
52
-
-`marks` - (optional) allows marking a cell with the required values; it's an object where keys are CSS class names and values are either a function or one of the predefined strings ("max", "min"). The default value is {}. The function should return boolean for the checked value; if **true** is returned, the css class is assigned to the cell. More information with examples see here [Marking cells](/guides/stylization#cell-style).
50
+
- the value is a function that returns a string and receives cell value and operation. All columns based on the specified field will have the related template applied. For example, it allows setting the units of measurement or returning the required number of digits after the decimal point for numeric values, etc. See the example below.
51
+
-`marks` - (optional) allows marking a cell with the required values; it's an object where keys are CSS class names and values are either a function or one of the predefined strings ("max", "min"). The function should return boolean for the checked value; if **true** is returned, the css class is assigned to the cell. More information with examples see here [Marking cells](/guides/stylization#cell-style).
53
52
-`sizes` - (optional) defines the following size parameters of the table:
54
53
-`rowHeight` - (optional) the row height in the Pivot table in pixels; the default value is 34
55
54
-`headerHeight` - (optional) the header height in pixels; the default value is 30
@@ -59,7 +58,8 @@ tableShape?: {
59
58
-`field` - (required) a string representing the field name for which the style is applied
60
59
-`value` - (required) the value of the cell (the actual data for that particular row and column)
61
60
-`area` - (required) a string indicating the area of the table where a cell resides ("rows", "columns" or "values" area)
62
-
-`method` - (optional) a string that can represent the operation performed on a cell (e.g., "sum", "count", etc.).
61
+
-`method` - (optional) a string that can represent the operation performed on a cell (e.g., "sum", "count", etc.)
62
+
-`isTotal` - (optional) defines whether a cell belongs to a total row, total column, or both: "row"|"column"|"both
63
63
The `cellStyle` function returns a string, which can be used as a CSS class name to apply specific styles to a cell.
64
64
-`tree` - (optional) if set to **true**, enables the tree mode when data can be presented with expandable rows; the default value is **false**; more information with examples see here [Switching to the tree mode](/guides/configuration/#enabling-the-tree-mode)
65
65
-`totalColumn` - (optional) if **true**, enables generating the total column with total values for rows (**false** is set by default); if the value is set to "sumOnly", the column with the total sum value will be generated (available only for sum operations)
Copy file name to clipboardExpand all lines: docs/guides/configuration.md
+5-12Lines changed: 5 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -324,9 +324,7 @@ The widget allows freezing columns on the left or right side, which makes the co
324
324
325
325
### Freezing columns on the left
326
326
327
-
:::info
328
-
The number of columns that are split is equal to the number of the rows fields that are defined in the [`config`](/api/config/config-property) property. 2 columns are fixed by default. In the **tree** mode only one column gets frozen regardless of the number of the rows fields that are defined.
329
-
:::
327
+
The number of columns that are split is equal to the number of the rows fields that are defined in the [`config`](/api/config/config-property) property. In the **tree** mode only one column gets frozen regardless of the number of the rows fields that are defined. In the sample below, 1 column is fixed initially on the left, which is equal to the number of fields defined for the "rows" area.
330
328
331
329
~~~jsx {19}
332
330
const table = new pivot.Pivot("#root", {
@@ -347,19 +345,14 @@ const table = new pivot.Pivot("#root", {
347
345
]
348
346
},
349
347
tableShape: {
350
-
split: {left: true } //freezes all fields from rows on the left side
348
+
split: {left: true }
351
349
}
352
350
});
353
351
~~~
354
352
355
-
You can also apply a custom split using the [`render-table`](/api/events/render-table-event) event.
356
-
357
-
:::info
358
-
For the custom split, the number of columns that are split depends on the number of the rows and values fields that are defined in the [`config`](/api/config/config-property) property.
359
-
It's not recommended to split columns with colspans.
360
-
:::
353
+
You can also apply a custom split using the [`render-table`](/api/events/render-table-event) event. It's not recommended to split columns with colspans.
361
354
362
-
In the example below we split all rows fields (two rows are defined in the config) and the first two columns (the first two values fields).
355
+
In the sample below all columns from the "rows" area and first 4 columns from the "values" area are fixed initially. The number of columns that are split depends on the number of the rows and values fields that are defined via the [`config`](/api/config/config-property) property.
363
356
364
357
~~~jsx {19-25}
365
358
const table = new pivot.Pivot("#root", {
@@ -418,7 +411,7 @@ const widget = new pivot.Pivot("#pivot", {
418
411
});
419
412
~~~
420
413
421
-
To fix custom columns on the right, you need to apply the table API via the [`render-table`](/api/events/render-table-event) event.
414
+
To fix custom columns on the right, you need to apply the table API via the [`render-table`](/api/events/render-table-event) event. It's not recommended to split columns with colspans. In the sample below, 2 columns on the right are fixed initially.
Copy file name to clipboardExpand all lines: docs/guides/stylization.md
+1-3Lines changed: 1 addition & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,6 @@ To apply a CSS class to a cell, use the `cellStyle` parameter of the [`tableShap
119
119
~~~
120
120
121
121
122
-
123
122
## Marking cells
124
123
125
124
The widget API allows marking cells with the required values. You can do it by applying the `marks` parameter of the [`tableShape`](/api/config/tableshape-property) property. You need to do the following:
@@ -180,7 +179,7 @@ const table = new pivot.Pivot("#root", {
180
179
181
180
## Aligning numbers in a cell
182
181
183
-
By default, numbers are justified against the end of a cell (aligned to the right) and the number alignment is not applied in headers and in the tree mode (when `tree` is set to **true**for the [`tableShape`](/api/config/tableshape-property) property). If you want to change the number alignmentin a cell, except forthe cases mentioned, use the `wx-number`CSSclass.
182
+
By default, inthe table body numbers are aligned to the rightwith the help of the built-in`.wx-number`CSSclass. The exception is the hierarchical column in the tree mode (when `tree` is set to **true**for the [`tableShape`](/api/config/tableshape-property) property). To reset the default number alignment, change the relatedCSSclass.
184
183
185
184
~~~html
186
185
<style>
@@ -190,7 +189,6 @@ By default, numbers are justified against the end of a cell (aligned to the righ
190
189
</style>
191
190
~~~
192
191
193
-
194
192
## Example
195
193
196
194
In this snippet you can see how to apply a custom style to Pivot
0 commit comments