DataCell
Examples
See these.
The data for a cell of a DataTable.
Inherits: Control
Properties
content- The content of this cell.placeholder- Whether the content is actually a placeholder.show_edit_icon- Whether to show an edit icon at the end of this cell.
Events
on_double_tap- Called when this cell is double tapped.on_long_press- Called if this cell is long-pressed.on_tap- Called if this cell is tapped.on_tap_cancel- Called if the user cancels a tap was started on cell.on_tap_down- Called if this cell is tapped down.
Properties
contentinstance-attribute
content: Annotated[StrOrControl, V.str_or_visible_control()]The content of this cell.
Typically a Text control or a Dropdown control.
If the cell has no data, then a Text control with placeholder text
should be provided instead, and placeholder should be set to
True.
Raises:
- ValueError - If it is neither a string nor a visible
Control.
placeholderclass-attributeinstance-attribute
placeholder: bool = FalseWhether the content is actually a placeholder.
If this is True, the default text style for the cell is changed to be appropriate
for placeholder text.
show_edit_iconclass-attributeinstance-attribute
show_edit_icon: bool = FalseWhether to show an edit icon at the end of this cell.
This does not make the cell actually editable; the caller must implement editing behavior if desired (initiated from the on_tap callback).
If this is set, on_tap should also be set, otherwise tapping the icon will have no effect.
Events
on_double_tapclass-attributeinstance-attribute
on_double_tap: Optional[ControlEventHandler[DataCell]] = NoneCalled when this cell is double tapped.
If this is None (including on_tap, on_long_press,
on_tap_cancel, on_tap_down), tapping this cell will
attempt to select its row (if flet.DataRow.on_select_change is provided).
on_long_pressclass-attributeinstance-attribute
on_long_press: Optional[ControlEventHandler[DataCell]] = NoneCalled if this cell is long-pressed.
If this is None (including on_tap, on_double_tap,
on_tap_cancel, on_tap_down), tapping this cell will attempt
to select its row (if flet.DataRow.on_select_change is provided).
on_tapclass-attributeinstance-attribute
on_tap: Optional[ControlEventHandler[DataCell]] = NoneCalled if this cell is tapped.
If this is None (including on_double_tap, on_long_press,
on_tap_cancel, on_tap_down), tapping this cell will
attempt to select its row (if flet.DataRow.on_select_change is provided).
on_tap_cancelclass-attributeinstance-attribute
on_tap_cancel: Optional[ControlEventHandler[DataCell]] = NoneCalled if the user cancels a tap was started on cell.
If this is None (including on_tap, on_double_tap,
on_long_press, on_tap_down), tapping this cell will
attempt to select its row (if flet.DataRow.on_select_change is provided).
on_tap_downclass-attributeinstance-attribute
on_tap_down: Optional[EventHandler[TapEvent[DataCell]]] = NoneCalled if this cell is tapped down.
If this is None (including on_tap, on_double_tap,
on_long_press, on_tap_cancel), tapping this cell will
attempt to select its row (if flet.DataRow.on_select_change is provided).