Skip to main content

DataColumn

Examples

See these.

Column configuration for a DataTable.

Inherits: Control

Properties

  • heading_row_alignment - Defines the horizontal layout of the label and sort indicator in the heading row.
  • label - The column heading.
  • numeric - Whether this column represents numeric data or not.
  • tooltip - The column heading's tooltip.

Events

  • on_sort - Called when the user asks to sort the table using this column.

Properties

heading_row_alignmentclass-attributeinstance-attribute

heading_row_alignment: Optional[MainAxisAlignment] = None

Defines the horizontal layout of the label and sort indicator in the heading row.

labelinstance-attribute

label: Annotated[StrOrControl, V.str_or_visible_control()]

The column heading.

Typically, this will be a Text control. It could also be an Icon (typically using size 18), or a combination of both in a Row.

Raises:

  • ValueError - If it is neither a string nor a visible Control.

numericclass-attributeinstance-attribute

numeric: bool = False

Whether this column represents numeric data or not.

The contents of cells of columns containing numeric data are right-aligned.

tooltipclass-attributeinstance-attribute

tooltip: Optional[str] = field(default=None, kw_only=True)

The column heading's tooltip.

This is a longer description of the column heading, for cases where the heading might have been abbreviated to keep the column width to a reasonable size.

Events

on_sortclass-attributeinstance-attribute

on_sort: Optional[EventHandler[DataColumnSortEvent]] = None

Called when the user asks to sort the table using this column.

If not set, the column will not be considered sortable.