@@ -8,19 +8,25 @@ function CheckboxCell(props: CellComponentProps) {
88 const { row, column, table } = defaultCell ;
99 const tableColumn = column . columnDef as TableColumn ;
1010
11- const [ rows , dataActions ] = table . options . meta . tableState . data ( ( state ) => [
12- state . rows ,
13- state . actions ,
14- ] ) ;
15- const columns = table . options . meta . tableState . columns (
16- ( state ) => state . columns
11+ const dataActions = table . options . meta . tableState . data (
12+ ( state ) => state . actions
1713 ) ;
18- const ddbbConfig = table . options . meta . tableState . configState (
19- ( state ) => state . ddbbConfig
14+
15+ const checkboxCell = table . options . meta . tableState . data (
16+ ( state ) => state . rows [ row . index ]
17+ ) ;
18+
19+ const columnsInfo = table . options . meta . tableState . columns (
20+ ( state ) => state . info
2021 ) ;
22+
23+ const configInfo = table . options . meta . tableState . configState (
24+ ( state ) => state . info
25+ ) ;
26+
2127 /** state of cell value */
2228 const [ checked , setChecked ] = useState (
23- Boolean ( rows [ row . index ] [ tableColumn . key ] )
29+ Boolean ( checkboxCell [ tableColumn . key ] )
2430 ) ;
2531 const handleChange = ( event : React . ChangeEvent < HTMLInputElement > ) => {
2632 const newValue = event . target . checked ? 1 : 0 ;
@@ -29,8 +35,8 @@ function CheckboxCell(props: CellComponentProps) {
2935 row . index ,
3036 column . columnDef as TableColumn ,
3137 newValue ,
32- columns ,
33- ddbbConfig
38+ columnsInfo . getAllColumns ( ) ,
39+ configInfo . getLocalSettings ( )
3440 ) ;
3541 setChecked ( event . target . checked ) ;
3642 } ;
0 commit comments