11import { isArray , isNumber } from '@visactor/vutils' ;
2- import type { BaseTableAPI , ListTableProtected } from '../../../ts-types/base-table' ;
2+ import type { BaseTableAPI } from '../../../ts-types/base-table' ;
33import { setCellCheckboxStateByAttribute } from '../../../state/checkbox/checkbox' ;
44import type { ListTableAPI } from '../../../ts-types' ;
55import { HierarchyState } from '../../../ts-types' ;
@@ -9,7 +9,10 @@ export function bindGroupTitleCheckboxChange(table: BaseTableAPI) {
99 table . on ( 'checkbox_state_change' , args => {
1010 const { col, row, checked, field } = args ;
1111
12- if ( field !== '_vtable_rowSeries_number' || table . internalProps . rowSeriesNumber ?. enableTreeCheckbox !== true ) {
12+ if (
13+ ! table . internalProps . layoutMap . isSeriesNumber ( col , row ) ||
14+ table . internalProps . rowSeriesNumber ?. enableTreeCheckbox !== true
15+ ) {
1316 return ;
1417 }
1518
@@ -30,7 +33,7 @@ export function bindGroupTitleCheckboxChange(table: BaseTableAPI) {
3033 // 1.1 group title check
3134 // 1.1.1 check all children
3235 if ( getHierarchyState ( table , col , row ) === HierarchyState . collapse ) {
33- updateChildrenCheckboxState ( true , titleIndex , table , field ) ;
36+ updateChildrenCheckboxState ( true , titleIndex , table , field as string ) ;
3437 } else {
3538 setAllChildrenCheckboxState ( true , titleShowIndex , titleIndex , indexedData , table , col ) ;
3639 }
@@ -40,7 +43,7 @@ export function bindGroupTitleCheckboxChange(table: BaseTableAPI) {
4043 // 1.2 group title uncheck
4144 // 1.2.1 uncheck all children
4245 if ( getHierarchyState ( table , col , row ) === HierarchyState . collapse ) {
43- updateChildrenCheckboxState ( false , titleIndex , table , field ) ;
46+ updateChildrenCheckboxState ( false , titleIndex , table , field as string ) ;
4447 } else {
4548 setAllChildrenCheckboxState ( false , titleShowIndex , titleIndex , indexedData , table , col ) ;
4649 }
0 commit comments