Warning |
---|
This Field is still under construction, its usage is not recommended yet. |
The Table Field is for displaying collections of data that might be displayed as a table.
...
Here, "field" is the original column name, "label" is the new label to display, and "prefix" is an additional option specific to individual cells within the column.
...
Note |
---|
Options like "prefix" apply only to the cells within the column and do not affect the column definition itself. |
...
Schema Details
ParameterProperty | Type | Description | Required | Default |
---|
Required | Description | columns_exclude | Optional[List[str]] | [] | False | | Enum |
---|
type | string | The type of field. | No | table | table |
label | string/null | Label to show for this field. | No | null |
|
css_style | object/null | Style to apply in the HTML of the UI. | No | null |
|
css_class | string/null | CSS class to apply in the HTML component. | No | null |
|
translate | string/null | Translation key for the field. | No | null |
|
translate_label | string/null | Translation key for the label. | No | null |
|
analytics | object/null | Analytics configuration. | No | null |
|
if_not_exist | string/null | Show only if the specified field doesn't exist. | No | null |
|
if_exist | string/null | Show only if the specified field does exist. | No | null |
|
only_on_highlight | boolean | Show only when the value is highlighted. | No | false |
|
display | any | Value from the field. | No | null |
|
field | string | Path to field from which to retrieve the value (in JMESPath format). | Yes |
|
|
field_highlight | string/null | Path to highlight field from which to retrieve the value, in case it is not the same as the field parameter (in JMESPath format). | No | null |
|
default | any | Default value to use in case no value was found for the field. | No | null |
|
transform | array/string/null | List of transformations to apply to the displayed values. | No | null |
|
suffix | string/null | Suffix to append to the value or values. | No | null |
|
prefix | string/null | Prefix to append to the value or values. | No | null |
|
suffix_label | string/null | Suffix to append to the label of the field. | No | null |
|
prefix_label | string/null | Prefix to append to the label of the field. | No | null |
|
sort | string/boolean | Sort order for values in an array. | No | false | asc, desc |
unique | boolean | If the values are in an array, remove the duplicates. | No | false |
|
show_blank | boolean | If there is no value, or value is null, and show_blank is true, keep the field. | No | false |
|
replacement | string/null | Replacement string for matches in the transformations Transformation.REPLACE_FIRST , Transformation.REPLACE_LAST , and Transformation.REPLACE_ALL . | No | null |
|
pattern | string/null | Pattern used to look for matches in the transformations Transformation.REPLACE_FIRST , Transformation.REPLACE_LAST , and Transformation.REPLACE_ALL . | No | null |
|
columns_exclude | array/string/null | Name of the columns |
List of column names to exclude from the response. |
columns_definition | Optional[List[DynamicField]] | [] | False | List of column definitions. Each definition defines No | [] |
|
columns_definition | array/object/null | Definitions of how to display the cells of the column |
, . Each definition in this list will define the display of the cells and the label of the definition will be used as the new |
label for the The field should match the original name of the column. These also set the order in which the columns will appear in the table, with the defined columns having priority over the undefined ones.-str | True | Path, from the root table, to the |
column columns names. The result of this path should be a list of text. | Yes |
|
|
rows_path |
str- | True | Path, from the root table, to the row values. The result of this path should be an array with all the rows for the table. |
autocomplete | Optional[bool] | True | False | Activates |
verbose | Optional[bool] | False | False | TableField(field='metadata', columns_path='keys(cast[0])', rows_path='cast[*].*', autocomplete=True,
columns_definition=[NumberField(field='id', label='Char Id', format='1.0'),
TextField(field='name', label='Actor name'),
TextField(field='character', label='Rol')], verbose=False)
_TableFieldUI
...
| Yes |
|
|
include_additional_cols | boolean/null | Toggles the additional_columns feature. If active, the table will be built using every column on columns_path except the excluded columns. If inactive, the table will be built using only the columns in columns_definition. | No | true |
|
Example JSON Representation
Code Block |
---|
|
{
"type": "table",
"label": "Employee Data",
"css_style": null,
"css_class": null,
"translate": null,
"translate_label": null,
"analytics": null,
"if_not_exist": null,
"if_exist": null,
"only_on_highlight": false,
"display": null,
"field": "employee_table",
"field_highlight": null,
"default": null,
"transform": null,
"suffix": null,
"prefix": null,
"suffix_label": null,
"prefix_label": null,
"sort": false,
"unique": false,
"show_blank": false,
"replacement": null,
"pattern": null,
"columns_exclude": [],
"columns_definition": [],
"columns_path": "columns",
"rows_path": "rows",
"include_additional_cols": true
}
|
Code Example of Usage
Code Block |
---|
|
table_field_example = TableField(
field="employee_table",
columns_path="columns",
rows_path="rows",
include_additional_cols=True
)
|
...