Skip to content

Commit f2633c6

Browse files
committed
[update] exporting_data updated
1 parent f7fe728 commit f2633c6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

docs/guides/exporting-data.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ To export the table data to the XLSX or CSV format, it's necessary to get access
1414
result: any
1515
}) => boolean|void;
1616
```
17-
1817
The `export` action of the Table widget has the next parameters that you can configure to your needs:
1918

2019
- `options` - an object with the export options; options differ depending on the format type:
2120
- `format` (string) - (optional) the export format that can be "csv" or "xlsx"
2221
**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+
:::
2325
- `fileName` (string) - (optional) a name of .xlsx file ("data" by default)
2426
- `sheetName` (string) - a name of Excel sheet ( "data" by default)
2527
- `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
3436
~~~
3537
If `styles` is set to **false**, grid will be exported without any styling.
3638
- `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`
3840
- `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`
3941
- `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`
4042
- `header` (boolean) - (optional) defines if a header should be exported (**true** by default)
@@ -87,10 +89,6 @@ exportButton.textContent = "Export";
8789
document.body.appendChild(exportButton);
8890
~~~
8991

90-
:::info
91-
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.
92-
:::
93-
9492
## Example
9593

9694
In this snippet you can see how to export data:

0 commit comments

Comments
 (0)