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
Copy file name to clipboardExpand all lines: docs/guides/configuration.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -170,7 +170,7 @@ const table = new pivot.Pivot("#root", {
170
170
171
171
### Adding a template via the template helper
172
172
173
-
You can also define a template as a cell property of the `column` object via the [`pivot.template`](/api/helpers/template) helper. You need to apply it right before the table renders, which is done by intercepting the [render-table](/api/events/render-table-event) event using the [api.intercept()](/api/internal/intercept-method) method. Use this event to modify the table's config, namely the `columns` array. Define the template via the `pivot.template` helper.
173
+
You can insert HTML content to table cells via the [`pivot.template`](/api/helpers/template) helper by defining a template as a `cell` property of the `column` object. You need to apply the template right before the table renders, which is done by intercepting the [render-table](/api/events/render-table-event) event using the [api.intercept()](/api/internal/intercept-method) method.
174
174
175
175
The example shows how you can add icons (star or flag icon) to body cells based on their field (id, user_score):
176
176
@@ -251,7 +251,7 @@ const table = new pivot.Pivot("#root", {
251
251
252
252
### Adding templates via the template helper
253
253
254
-
You can also define a template as a cell property of the `header` object via the [`pivot.template`](/api/helpers/template) helper. You need to apply it right before the table renders, which is done by intercepting the [render-table](/api/events/render-table-event) event using the [api.intercept()](/api/internal/intercept-method) method. Use this event to modify the table's config, namely the `header` parameter in the `columns` array. Define the template via the `pivot.template` helper.
254
+
You can insert HTML content to header cells via the [`pivot.template`](/api/helpers/template) helper by defining a template as a `cell` property of the header cell object. You need to apply the template right before the table renders, which is done by intercepting the [render-table](/api/events/render-table-event) event using the [api.intercept()](/api/internal/intercept-method) method.
Copy file name to clipboardExpand all lines: docs/guides/custom-formatting.md
+2-5Lines changed: 2 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ const fields = [
18
18
];
19
19
~~~
20
20
21
-
By default, the format for numeric values limits fraction digits to 3 and applies group separation for the integer part. The `format` parameter allows you to display numeric values without group separation (for example, years):
21
+
By default, the format for numeric values limits fraction digits to 3 and applies group separation for the integer part. You can cancel formatting by setting `format` to *false* in the `field` configuration:
22
22
23
23
~~~js
24
24
constfields= [
@@ -86,7 +86,7 @@ const fields = [
86
86
];
87
87
~~~
88
88
89
-
In the example below we set the date format to "%d %M %Y %H:%i" for the "date" field only. The format displays day, full month name, year, hours, and minutes, e.g., "24 April 2025 14:30".
89
+
In the example below we set the date format to "%d %M %Y %H:%i" for the "date" field only. The format displays day, full month name, year, hours, and minutes, e.g., "24 April 2025 14:30". In case you need to disable formatting of some fields, set the `format` parameter of the [`fields`](/api/config/fields-property) property to *false*.
90
90
91
91
~~~jsx
92
92
constfields= [
@@ -134,9 +134,6 @@ new pivot.Pivot("#pivot", {
134
134
});
135
135
~~~
136
136
137
-
:::info
138
-
In case you need to disable formatting of some fields, set the `format` parameter of the [`fields`](/api/config/fields-property) property to *false*.
Copy file name to clipboardExpand all lines: docs/guides/stylization.md
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ You can also apply a custom style to the scroll bar of Pivot. For this, you can
100
100
101
101
## Cell style
102
102
103
-
To apply a CSS class to the table body cell, use the `cellStyle` parameter of the [`tableShape`](/api/config/tableshape-property) property. The style of the header and footer cells can be customized via the `cellStyle` parameter of the [`headerShape`](/api/config/tableshape-property) property. In both cases the `cellStyle` function returns a string, which can be used as a CSS class name to apply specific styles to a cell.
103
+
To apply a CSS class to the table body or footer cells, use the `cellStyle` parameter of the [`tableShape`](/api/config/tableshape-property) property. The style of the header cells can be customized via the `cellStyle` parameter of the [`headerShape`](/api/config/tableshape-property) property. In both cases the `cellStyle` function returns a string, which can be used as a CSS class name to apply specific styles to a cell.
104
104
105
105
In the example below the styles of cells in the table body and headers are customized in the following way:
106
106
- for the table body cells, styles are applied dynamically based on cell values (e.g., "Down", "Up", "Idle") in the "status" field and on total values (greater than 40 or less than 5)
@@ -155,20 +155,9 @@ const widget = new pivot.Pivot("#pivot", {
155
155
});
156
156
~~~
157
157
158
-
It's also possible to customize the style of total columns and total rows via the `wx-total` class:
158
+
## Marking values in cells
159
159
160
-
~~~html
161
-
<style>
162
-
.wx-cell.wx-total {
163
-
background: #fafafb;
164
-
font-weight: var(--wx-header-font-weight);
165
-
}
166
-
</style>
167
-
~~~
168
-
169
-
## Marking cells
170
-
171
-
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:
160
+
The widget API allows marking required values in cells. You can do it by applying the `marks` parameter of the [`tableShape`](/api/config/tableshape-property) property. You need to do the following:
172
161
- create a CSS class to be applied to the marked cell
173
162
- add the CSS class name as the parameter of the `marks` object
174
163
- set its value which can be a custom 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.
@@ -224,7 +213,7 @@ const table = new pivot.Pivot("#root", {
224
213
</style>
225
214
~~~
226
215
227
-
## Aligning numbers in a cell
216
+
## Specific CSS classes
228
217
229
218
By default, in the table body numbers are aligned to the right with the help of the built-in `.wx-number` CSS class. 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 related CSS class.
230
219
@@ -236,6 +225,17 @@ By default, in the table body numbers are aligned to the right with the help of
236
225
</style>
237
226
~~~
238
227
228
+
It's also possible to customize the style of total columns and total rows via the ` .wx-total` CSS class:
229
+
230
+
~~~html
231
+
<style>
232
+
.wx-cell.wx-total {
233
+
background: #fafafb;
234
+
font-weight: var(--wx-header-font-weight);
235
+
}
236
+
</style>
237
+
~~~
238
+
239
239
## Example
240
240
241
241
In this snippet you can see how to apply a custom style to Pivot
0 commit comments