useRowSelect
useRowSelect
is the hook that implements basic row selection. For more information on row selection, see Row Selection
The following options are supported via the main options object passed to useTable(options)
initialState.selectedRowIds: Object<rowId: Boolean>
{}
true
in this object, it will have a selected state.manualRowSelectedKey: String
isSelected
autoResetSelectedRows: Boolean
true
true
, the selectedRowIds
state will automatically reset if any of the following conditions are met:data
is changedfalse
The following values are provided to the table instance
:
toggleRowSelected: Function(rowPath: String, ?set: Bool) => void
true
or false
to set it to that statetoggleAllRowsSelected: Function(?set: Bool) => void
true
or false
to set all rows to that statetoggleAllPageRowsSelected: Function(?set: Bool) => void
true
or false
to set all rows to that stategetToggleAllPageRowsSelectedProps: Function(props) => props
onChange: Function()
style.cursor: 'pointer'
checked: Bool
indeterminate: Bool
title: 'Toggle All Rows Selected'
getToggleAllRowsSelectedProps: Function(props) => props
onChange: Function()
style.cursor: 'pointer'
checked: Bool
indeterminate: Bool
title: 'Toggle All Rows Selected'
isAllRowsSelected: Bool
true
if all rows are selected.false
selectedFlatRows: Array<Row>
The following additional properties are available on every prepared row
object returned by the table instance.
isSelected: Bool
true
if the row is currently selectedisSomeSelected: Bool
true
if the row has subRows and at least one of them is currently selectedtoggleRowSelected: Function(?set)
true
or false
to set it to that stategetToggleRowSelectedProps: Function(props) => props
onChange: Function()
style.cursor: 'pointer'
checked: Bool
title: 'Toggle Row Selected'
The best JavaScript newsletter! Delivered every Monday to over 76,000 devs.