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/exporting-data.md
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -14,12 +14,14 @@ To export the table data to the XLSX or CSV format, it's necessary to get access
14
14
result: any
15
15
}) => boolean|void;
16
16
```
17
-
18
17
The `export` action of the Table widget has the next parameters that you can configure to your needs:
19
18
20
19
-`options` - an object with the export options; options differ depending on the format type:
21
20
-`format` (string) - (optional) the export format that can be "csv" or "xlsx"
22
21
**Options for "xlsx" format:**
22
+
:::info
23
+
By default, for the "xlsx" format, date and number fields are exported as raw values with default format or the format defined via the [`fields`](/api/config/fields-property) property. But if a template is defined for a field (see the [`tableShape`](/api/config/tableshape-property) property), it exports the rendered value defined by that template. In case both the template and `format` are set, the template settings will override the format ones.
24
+
:::
23
25
- `fileName` (string) - (optional) a name of .xlsx file ("data" by default)
24
26
- `sheetName` (string) - a name of Excel sheet ( "data" by default)
25
27
- `styles` - custom styles for cells in the header, body, and footer. Can be configured using a hash of style properties:
@@ -34,7 +36,7 @@ The `export` action of the Table widget has the next parameters that you can con
34
36
~~~
35
37
If `styles` is set to **false**, grid will be exported without any styling.
36
38
- `cellTemplate` - a function to customize the export value of each cell. It takes the value, row, and column objects as parameters and returns the custom value to be exported: `(value, rowObj, columnObj) => string`
37
-
- `headerCellTemplate` - a function that customizes the value of a header or footer cell during export. It is called with the text, header cell object, column object, and cell type ("header" or "footer"). This allows users to modify the exported header/footer values: `(text, headerCell, columnObj, type: "header"| "footer") => string`
39
+
- `headerCellTemplate` - a function that customizes the value of a header or footer cell during export. It is called with the text, header cell object, column object, and cell type ("header" or "footer"). This allows users to modify the exported header/footer values. `(text, headerCell, columnObj, type: "header"| "footer") => string`
38
40
- `cellStyle` - a function that allows customizing the style and format of individual cells during export. It takes the value, row, and column objects as parameters and should return an object with style properties (e.g., alignment or format): `(value, rowObj, columnObj) => any | null`
39
41
- `headerCellStyle` - similar to cellStyle, but specifically for the header and footer cells. This function takes the text, header cell object, column object, and type ("header" or "footer") and returns style properties: `(text, headerCell, columnObj, type: "header"| "footer") => any | null`
40
42
- `header` (boolean) - (optional) defines if a header should be exported (**true** by default)
Raw values are exported for date and number fields with visible formatting, but if a template is defined for a field, it exports the rendered value defined by that template. You can also configure the export settings via the `format` parameter of the [`fields`](/api/config/fields-property) property. In case both the template and format are set, the template settings will override the format ones.
0 commit comments