Skip to content

DataCell

Examples#

See these.

Inherits: Control

The data for a cell of a DataTable.

Properties

Events

Properties#

content #

content: StrOrControl

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.

Tip

To lay out multiple children, set the content to a container-like control such as Row, Column, or Stack, which have a controls property.

Raises:

placeholder #

placeholder: bool = False

Whether 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_icon #

show_edit_icon: bool = False

Whether 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).

Note

If this is set, on_tap should also be set, otherwise tapping the icon will have no effect.

Events#

on_double_tap #

on_double_tap: ControlEventHandler[DataCell] | None = None

Called when this cell is double tapped.

Note

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 DataRow.on_select_change is provided).

on_long_press #

on_long_press: ControlEventHandler[DataCell] | None = None

Called if this cell is long-pressed.

Note

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 DataRow.on_select_change is provided).

on_tap #

on_tap: ControlEventHandler[DataCell] | None = None

Called if this cell is tapped.

Note

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 DataRow.on_select_change is provided).

on_tap_cancel #

on_tap_cancel: ControlEventHandler[DataCell] | None = None

Called if the user cancels a tap was started on cell.

Note

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 DataRow.on_select_change is provided).

on_tap_down #

on_tap_down: EventHandler[TapEvent[DataCell]] | None = None

Called if this cell is tapped down.

Note

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 DataRow.on_select_change is provided).