TableState

Mutable state holder for a table instance.

Three clusters of that state live in holders of their own, reached through this one: columns (order, widths, auto-fit measurements), selection (focused row, checked rows, selected cell) and editing (edited row and column, edit callbacks). What shapes the data — sort, groupBy, filters — stays here, because it is what a table is asked for most and it belongs to the table as a whole rather than to one of the three.

The members those holders took over remain here as deprecated forwarders for one release, each naming its replacement, so existing call sites keep compiling; they are removed in the next major.

Types

Link copied to clipboard
data class SelectedCell<C>(val rowIndex: Int, val column: C)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Column order, width overrides and the measurements auto-fit works from.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Edited row and column, and the consumer's edit callbacks.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var groupBy: C?
Link copied to clipboard
val onEditCancel: (rowIndex: Int) -> Unit?
Link copied to clipboard
val onRowEditComplete: (rowIndex: Int) -> Boolean?
Link copied to clipboard
val onRowEditStart: (rowIndex: Int) -> Unit?
Link copied to clipboard

True while a non-null rowBlocks declaration is being ignored because groupBy is active. The two features describe incompatible structures over the same rows, so the library suppresses blocks instead of rendering both; this flag exists so consumers can surface that conflict in their own UI rather than have blocks vanish unexplained.

Link copied to clipboard

Tracks measured row heights in raw pixels for dynamic, precise scrolling.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Focused row, checked rows and the selected cell.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Current table width computed from visible columns and their widths. Automatically recalculates when column order, widths, or visibleColumns change.

Functions

Link copied to clipboard
Link copied to clipboard
fun completeCurrentCellEdit(visibleColumns: List<ColumnSpec<*, C, *>>)
Link copied to clipboard
fun focusRow(index: Int)
Link copied to clipboard
fun groupBy(column: C?)

Enable or disable grouping by a column

Link copied to clipboard
fun moveColumn(fromIndex: Int, toIndex: Int)
Link copied to clipboard
Link copied to clipboard
fun resizeColumn(column: C, action: ColumnWidthAction)
Link copied to clipboard
fun resolveColumnWidth(key: C, spec: ColumnSpec<*, C, *>? = null): Dp
Link copied to clipboard
fun selectCell(rowIndex: Int, column: C)
Link copied to clipboard
fun setColumnOrder(newOrder: List<C>)
Link copied to clipboard
fun setColumnWidths(widths: Map<C, Dp?>)
Link copied to clipboard
Link copied to clipboard
fun <T> setFilter(column: C, state: TableFilterState<T>?)

Set or clear filter state for column. Pass null to remove.

Link copied to clipboard
fun setSort(column: C, order: SortOrder? = null)

Toggle or set sorting for a column. If order is null, cycles ASC -> DESC -> none.

Link copied to clipboard
fun startEditing(item: Any?, rowIndex: Int, column: C): Boolean
Link copied to clipboard
fun toggleCheck(index: Int)
Link copied to clipboard
fun toggleCheckAll(count: Int)
Link copied to clipboard
fun toggleSelect(index: Int)
Link copied to clipboard
Link copied to clipboard
fun updateMaxContentWidth(column: C, width: Dp, source: String)
Link copied to clipboard
fun updateRowHeight(index: Int, heightPx: Int)

Record measured row height (in px) for index.