DataCell
Examples#
See these.
Inherits: Control
The data for a cell of a DataTable.
Properties
-
content(StrOrControl) –The content of this cell.
-
placeholder(bool) –Whether the
contentis actually a placeholder. -
show_edit_icon(bool) –Whether to show an edit icon at the end of this cell.
Events
-
on_double_tap(ControlEventHandler[DataCell] | None) –Called when this cell is double tapped.
-
on_long_press(ControlEventHandler[DataCell] | None) –Called if this cell is long-pressed.
-
on_tap(ControlEventHandler[DataCell] | None) –Called if this cell is tapped.
-
on_tap_cancel(ControlEventHandler[DataCell] | None) –Called if the user cancels a tap was started on cell.
-
on_tap_down(EventHandler[TapEvent[DataCell]] | None) –Called if this cell is tapped down.
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:
-
ValueError–If the
contentis neither a string nor a visible control.
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.
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).