You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From all examples I can find about row selection with react-table (useRowSelect), the checkbox is added like:
const{
...
selectedFlatRows,state: { selectedRowIds },}=useTable({
columns,
data,},useRowSelect,hooks=>{hooks.visibleColumns.push(columns=>[// Let's make a column for selection{id: 'selection',// The header can use the table's getToggleAllRowsSelectedProps method// to render a checkboxHeader: ({ getToggleAllRowsSelectedProps })=>(<div><IndeterminateCheckbox{...getToggleAllRowsSelectedProps()}/></div>),// The cell can use the individual row's getToggleRowSelectedProps method// to the render a checkboxCell: ({ row })=>(<div><IndeterminateCheckbox{...row.getToggleRowSelectedProps()}/></div>),},
...columns,])})
Is there any specific reason to not define the checkbox column in columns?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
From all examples I can find about row selection with
react-table
(useRowSelect
), the checkbox is added like:Is there any specific reason to not define the checkbox column in
columns
?Beta Was this translation helpful? Give feedback.
All reactions