File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ export function MTableHeader({
355
355
props . selectedCount > 0 && props . selectedCount < props . dataCount
356
356
}
357
357
checked = {
358
- props . dataCount > 0 && props . selectedCount == = props . dataCount
358
+ props . dataCount > 0 && props . selectedCount > = props . dataCount
359
359
}
360
360
onChange = { ( event , checked ) =>
361
361
props . onAllSelected && props . onAllSelected ( checked )
Original file line number Diff line number Diff line change @@ -1017,7 +1017,7 @@ export default class MaterialTable extends React.Component {
1017
1017
selectedCount = { this . state . selectedCount }
1018
1018
dataCount = {
1019
1019
props . parentChildData
1020
- ? this . state . originalData . length
1020
+ ? this . state . treefiedDataLength
1021
1021
: this . state . columns . some ( ( col ) => col . tableData . groupOrder > - 1 )
1022
1022
? this . state . groupedDataLength
1023
1023
: this . state . data . length
@@ -1184,6 +1184,7 @@ export default class MaterialTable extends React.Component {
1184
1184
< Droppable droppableId = "headers" direction = "horizontal" >
1185
1185
{ ( provided , snapshot ) => {
1186
1186
const table = this . renderTable ( props ) ;
1187
+ console . log ( 'state' , this . state ) ;
1187
1188
return (
1188
1189
< div ref = { provided . innerRef } >
1189
1190
< div
Original file line number Diff line number Diff line change @@ -378,8 +378,16 @@ export default class DataManager {
378
378
379
379
setCheck ( this . groupedData ) ;
380
380
} else {
381
+ const checkChild = ( row ) => {
382
+ row . tableData . childRows &&
383
+ row . tableData . childRows . forEach ( ( child ) => {
384
+ child . tableData . checked = isChecked ( row ) ;
385
+ checkChild ( child ) ;
386
+ } ) ;
387
+ } ;
381
388
this . searchedData . forEach ( ( row ) => {
382
389
row . tableData . checked = isChecked ( row ) ;
390
+ checkChild ( row ) ;
383
391
} ) ;
384
392
selectedCount = this . searchedData . length ;
385
393
}
You can’t perform that action at this time.
0 commit comments