datatable ¤
Data tables with selectable rows.
Classes:
-
Checkbox
–A checkbox, added to rows to make them selectable.
-
SelectableRow
–A selectable row.
-
SelectableRowsDataTable
–Data table with selectable rows.
SelectableRow dataclass
¤
SelectableRow(table: SelectableRowsDataTable, key: RowKey)
A selectable row.
Methods:
-
remove
–Remove row from the table.
-
select
–Select this row.
-
toggle_select
–Toggle-select this row.
-
unselect
–Unselect this row.
Attributes:
-
app
(App
) –Textual application.
-
checkbox
(Checkbox
) –Row checkbox.
-
data
(list
) –Row data (without checkbox).
-
index
(int
) –Row index.
-
next
(SelectableRow
) –Next row (down).
-
previous
(SelectableRow
) –Previous row (up).
-
selected
(bool
) –Whether this row is selected.
SelectableRowsDataTable ¤
Bases: DataTable
Data table with selectable rows.
Methods:
-
action_reverse_select
–Reverse selection.
-
action_toggle_select_all
–Toggle-select all rows.
-
action_toggle_select_down
–Toggle selection down.
-
action_toggle_select_row
–Toggle-select current row.
-
action_toggle_select_up
–Toggle selection up.
-
add_rows
–Add rows.
-
clear
–Clear rows and optionally columns.
-
force_refresh
–Force refresh table.
Attributes:
-
current_row
(SelectableRow
) –Currently selected row.
-
selectable_rows
(Iterator[SelectableRow]
) –Rows, as selectable ones.
-
selected_rows
(Iterator[SelectableRow]
) –Selected rows.
add_rows ¤
Add rows.
Automatically insert a column with checkboxes in position 0.
clear ¤
clear(columns: bool = True) -> SelectableRowsDataTable
Clear rows and optionally columns.
When clearing columns, automatically re-add a column for checkboxes.