DataColumn
Examples#
See these.
Inherits: Control
Column configuration for a DataTable
.
Properties
-
heading_row_alignment
(MainAxisAlignment | None
) –Defines the horizontal layout of the label and sort indicator in the heading row.
-
label
(StrOrControl
) –The column heading.
-
numeric
(bool
) –Whether this column represents numeric data or not.
-
tooltip
(str | None
) –The column heading's tooltip.
Events
-
on_sort
(EventHandler[DataColumnSortEvent] | None
) –Called when the user asks to sort the table using this column.
Properties#
heading_row_alignment
#
heading_row_alignment: MainAxisAlignment | None = None
Defines the horizontal layout of the label and sort indicator in the heading row.
label
#
label: StrOrControl
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 the
label
is neither a string nor a visible control.
numeric
#
numeric: bool = False
Whether this column represents numeric data or not.
The contents of cells of columns containing numeric data are right-aligned.
tooltip
#
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_sort
#
on_sort: EventHandler[DataColumnSortEvent] | None = None
Called when the user asks to sort the table using this column.
If not set, the column will not be considered sortable.