Replies: 1 comment
-
The way I understand it, you want to pass
Following is for example of row-select const {... } = useTable(
{
columns,
data,
},
useRowSelect,
hooks => {
hooks.getToggleAllRowsSelectedProps = [
(props, {instance}) => [ props, {
...
// Here change functionality
disabled: true,
...
} ]
];
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 checkbox
Header: ({ getToggleAllRowsSelectedProps }) => (
<div>
<IndeterminateCheckbox {...getToggleAllRowsSelectedProps()} />
</div>
),
// The cell can use the individual row's getToggleRowSelectedProps method
// to the render a checkbox
Cell: ({ row }) => (
<div>
<IndeterminateCheckbox {...row.getToggleRowSelectedProps()} />
</div>
),
},
...columns,
])
}
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All
I'm using an older version of React-Table (7.0.0-alpha.36) and I need to be able to programmatically disable the 'row select' checkboxes that are in my table. I've successfully built a table component using useRowSelect and the checkboxes appear and function as they should (both in the Header and each Cell) ...
Now I need to be able to disable all checkboxes. I don't want to remove them - I want to disable all of them.
In the code above as well as all the online references - I read about getToggleAllRowsSelectedProps and row.getToggleRowSelectedProps() - and both functions seem like the perfect way of setting a disable property.
The problem is - I have no clue about how to use either function. Can someone please help me ?
Thanks
Dave
Beta Was this translation helpful? Give feedback.
All reactions