File tree 2 files changed +6
-1
lines changed
examples/react/row-selection/src
packages/table-core/src/features
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ function App() {
40
40
< IndeterminateCheckbox
41
41
{ ...{
42
42
checked : row . getIsSelected ( ) ,
43
+ disabled : ! row . getCanSelect ( ) ,
43
44
indeterminate : row . getIsSomeSelected ( ) ,
44
45
onChange : row . getToggleSelectedHandler ( ) ,
45
46
} }
@@ -109,6 +110,8 @@ function App() {
109
110
state : {
110
111
rowSelection,
111
112
} ,
113
+ enableRowSelection : true , //enable row selection for all rows
114
+ // enableRowSelection: row => row.original.age > 18, // or enable row selection conditionally per row
112
115
onRowSelectionChange : setRowSelection ,
113
116
getCoreRowModel : getCoreRowModel ( ) ,
114
117
getFilteredRowModel : getFilteredRowModel ( ) ,
Original file line number Diff line number Diff line change @@ -295,7 +295,9 @@ export const RowSelection: TableFeature = {
295
295
296
296
if (
297
297
isAllPageRowsSelected &&
298
- paginationFlatRows . some ( row => ! rowSelection [ row . id ] )
298
+ paginationFlatRows . some (
299
+ row => row . getCanSelect ( ) && ! rowSelection [ row . id ]
300
+ )
299
301
) {
300
302
isAllPageRowsSelected = false
301
303
}
You can’t perform that action at this time.
0 commit comments