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.
In defining each column for display, there are specific attributes associated with the column itself and each individual cell within it. The fields for configuring a column include:
field: This attribute should align with the original column field name. It determines how the row values will be populated based on the provided column name.
label: If this attribute is provided, it will replace the original column name when rendering the column. This allows for custom labeling of the column.
For instance, consider the following example:
TextField(field='desc', label='Description', prefix=' * ')
This can be understood as:
TextField(field='COLUMN_ORIGINAL_NAME', label='COLUMN_NEW_NAME', prefix=' * ')
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.
It's important to note that options like "prefix" apply only to the cells within the column and do not affect the column definition itself.
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
columns_exclude | Optional[List[str]] | [] | False | List of column names to exclude from the response. |
columns_definition | Optional[List[DynamicField]] | [] | False | List of column definitions. Each definition defines how to display the cells of the column, and the label of the definition will be used as the new label for the column title. 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. |
columns_path | str | - | True | Path, from the root table, to the column names. The result of this path should be a list of text. |
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)
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
type | DynamicFieldType | TABLE | True | Type of the dynamic field. |