dash_mp_components.DataTable¶
- class dash_mp_components.DataTable(id: str | dict | None = None, className: str | None = None, data: Sequence | None = None, columns: Sequence | None = None, sortField: str | None = None, sortAscending: bool | None = None, secondarySortField: str | None = None, secondarySortAscending: bool | None = None, conditionalRowStyles: Sequence | None = None, selectableRows: bool | None = None, selectedRows: Any | None = None, singleSelectableRows: bool | None = None, hasHeader: bool | None = None, headerClassName: str | None = None, resultLabel: str | None = None, resultLabelPlural: str | None = None, pagination: bool | None = None, paginationIsExpanded: bool | None = None, footer: str | None = None, disableRichColumnHeaders: bool | None = None, **kwargs)[source]¶
Bases:
ComponentA DataTable component. Common wrapper for filters/inputs and their labels
Keyword arguments:
- id (string; optional):
The ID used to identify this component in Dash callbacks.
- className (string; optional):
Class name(s) to append to the component’s default class.
- columns (list; optional):
An array of column definition objects to control what is rendered in the table. See Column documentation for specifics on how to construct Column objects.
- conditionalRowStyles (list; optional):
List of conditions for styling rows based on a property (selector) and a value. Note that this prop currently only supports checking for value equivalence (i.e. row[selector] === value). See ConditionalRowStyle documentation for how to construct ConditionalRowStyle conditions.
- data (list; optional):
Array of data objects to display in the table.
- disableRichColumnHeaders (boolean; optional):
This is a temporary solution to allow SearchUI’s to render in Storybook. There is an issue with the dynamic column header components that causes Storybook to crash. Rendering column headers as plain PropTypes.strings fixes the problem. Note that this will disable column tooltips and unit labels.
- footer (string; optional):
Content to display below the table but inside the table’s box wrapper. Accepts markdown.
- hasHeader (boolean; optional):
Set to True to show a header with total number of rows and a columns selector.
- headerClassName (string; optional):
Optional class name to apply to the table header.
- pagination (boolean; optional):
Set to True to paginate the table records.
- paginationIsExpanded (boolean; optional):
If True, an expanded component will be used for pagination (same as in SearchUI). If False, a compact version will be used.
- resultLabel (string; optional):
A noun in singular form to describe what a result represents (e.g. “material”). This is displayed in the table header.
- resultLabelPlural (string; optional):
Plural form of the result label. If none supplied, it will automatically be the result label plus an “s”.
- secondarySortAscending (boolean; optional):
If including a secondarySortField, set whether it should ascend by default. True for ascending, False for descending.
- secondarySortField (string; optional):
Optionally include a secondary sort field. If the sortField ever becomes the same as the secondarySortField, the secondary field is removed. Must be a valid field and included in your list of columns.
- selectableRows (boolean; optional):
Optionally include/exclude checkboxes next to rows for selecting.
- selectedRows (boolean | number | string | dict | list; optional):
Property to maintain the state of selected rows so that they are accessible via Dash callback.
- singleSelectableRows (boolean; optional):
Combine with selectableRows prop to only allow one row to be selected at a time.
- sortAscending (boolean; optional):
If including a sortField, set whether it should ascend by default True for ascending, False for descending.
- sortField (string; optional):
Optionally include a field to sort by on initial load Must be a valid field and included in your list of columns.
- __init__(id: str | dict | None = None, className: str | None = None, data: Sequence | None = None, columns: Sequence | None = None, sortField: str | None = None, sortAscending: bool | None = None, secondarySortField: str | None = None, secondarySortAscending: bool | None = None, conditionalRowStyles: Sequence | None = None, selectableRows: bool | None = None, selectedRows: Any | None = None, singleSelectableRows: bool | None = None, hasHeader: bool | None = None, headerClassName: str | None = None, resultLabel: str | None = None, resultLabelPlural: str | None = None, pagination: bool | None = None, paginationIsExpanded: bool | None = None, footer: str | None = None, disableRichColumnHeaders: bool | None = None, **kwargs)¶
Methods
__init__([id, className, data, columns, ...])to_plotly_json()Attributes
REQUIREDUNDEFINEDavailable_wildcard_properties