Export
Supported type
Here is the list of the typeCell supported by the export feature. We try to render the value as close as possible from the view mode.
typeCell | Supported | Type | Output |
---|---|---|---|
Amount | YES | string | The formatted value using the formatAmount property. |
Attachment | YES | string | The documents URI separated by commas. |
Autocomplete | YES | string | The selected value. If multiple , the selected values separated by commas. |
Badge | YES | string | One of the BADGE_STATUS label (in french). |
Button | NO | ||
Checkbox | YES | string | 'X' if checked and empty string if not. |
Chip | NO | ||
Custom | YES | string | If the data linked to the column is a number or a string, the value is returned. Otherwise, it returns a empty string. |
Date | YES | string | The formatted value using the outputFormat property. |
Multiple | NO | ||
Number | YES | number | The cell value. |
Select | YES | string | The selected value label . |
Status | YES | string | The selected value label . |
String | YES | string | The cell value. |
Thumbnail | YES | string | The documents URI separated by commas. |
Wallet | YES | string | The list of id from the array object separated by commas. |
Custom formating
The renderExport
property can be used to intercept any column result.
The renderExportFooter
property can be used to intercept any footer.
Example
Override the value of the checkbox cell.
// data
{
"isValid": true,
}
// config
{
key: 'isValid',
typeCell: 'check_box',
renderExport: (row, value) => value === 'X' ? 'YES' : 'NO',
renderExportFooter: (column, rows) => ['1', '2', '3']
}
Create a custom value with other data.
// data
{
"debit": 100,
"credit": 50
}
// config
{
key: 'diff',
typeCell: 'custom',
renderExport: ({ debit, credit }) => debit - credit
}
Ignore columns
You can ignore some columns from the export by setting the property ignoreExport: true
.
Disable the feature
The export feature is activated by default. To disable it, the following config as to be used.
<VirtualTable
config={
{
...yourConfig,
exportFormat: []
}
}
/>