Click here to Skip to main content
15,881,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i am using carbon design system with react i need control Ceheck state of TableSelectRow. how can i do bind selected row to the datatable


JavaScript
<pre><TableBody>
                    {rows.map((row) => (
                      <TableRow key={row.id}>
                        <TableSelectRow
             
                          {...getSelectionProps({
                            row,
                            onClick: () => setRowData(row),
                          })}
                        />
                        {row.cells.map((cell) => (
                          <TableCell key={cell.id}>{cell.value}</TableCell>
                        ))}
                      </TableRow>
                    ))}
                  </TableBody>



What I have tried:

normally when screen render and then json data list bind to the carbon datatable, as u can see m code. i am using TableSelectRow so grid has checkbox. normally, i can check of the tables rows and then take in the state. so, when page render again, table rows should be selected
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900