Data Table State
State holder for DataTable.
Provides programmatic access to scroll position, focused row and cell, cell editing, and column widths. Create via rememberDataTableState.
Constructors
Properties
Column keys in the order the user put them, or empty while they are in declared order.
Message from DataTableHeader.validateEdit rejecting the last attempted commit, or null.
The cell being edited, or null when no editor is open.
Index of the first visible item in the vertical list.
The focused cell, or null while focus is on a whole row or nowhere at all.
DataTableHeader.key of the column that currently has keyboard focus, or null when focus is on a whole row rather than a cell.
Key of the row that currently has keyboard focus, or null when no row is focused.
Columns the user has hidden, by DataTableHeader.key.
Whether an editor is currently open. Editing always happens at focusedCell.
The selected block of cells, or null when nothing is anchored.
The cell a range selection is anchored to — the corner that stays put while the cursor moves — or null when only a single cell is selected.
Functions
Animates scrolling so that the given item index is visible.
Puts a captured layout back.
Closes any open editor, discarding what was typed. Reports the abandoned edit to DataTable's onEditCancel.
Captures how the table is arranged right now: widths, hidden columns, order, sort, and filters.
Collapses the selection back to the single focused cell.
Extends the selection to one cell, the way Shift+click does.
Whether one cell falls inside the selected range.
Whether the user has hidden this column. Says nothing about DataTableHeader.visible, so a column can be shown by this and still not be rendered.
Moves one column to a position among the others, the way dragging its header would.
Clears all user-resized column widths, reverting to header-defined or weighted widths.
Drops every column override — widths, hidden columns, and order — leaving the table as its headers declare it.
Scrolls both axes so the focused cell is on screen. No-op when nothing is focused.
Scrolls the table so that the given item index is visible.
Selects the block of cells between two corners, leaving the cursor on focus.
Hides or shows one column, by DataTableHeader.key.
Opens the editor on one cell, as Enter or F2 would.