'How to multiple select the table row in React-table using the ctrl And Shift Click?
Code:-
<table {...getTableProps()} className="table">
<thead>
{headerGroups.map((headerGroup) => (
<tr {...headerGroup.getHeaderGroupProps()} id="header-fixed">
{headerGroup.headers.map((column) => (
<th {...column.getHeaderProps()}>{column.render("Header")}</th>
))}
</tr>
))}
</thead>
<tbody {...getTableBodyProps()}>
{rows.map((row, i) => {
prepareRow(row);
return (
<tr
{...row.getRowProps({
onClick: () => {
console.log("ROW", row.id);
}
})}
className="border_bottom"
tabIndex={i}
onKeyDown={(e) => handleKeyDown(e, i)}
onLoad={() => active(i)}
ref={i === 0 ? myRef : null}
>
{row.cells.map((cell) => {
return <td {...cell.getCellProps()}>{cell.render("Cell")}</td>;
})}
</tr>
);
})}
</tbody>
</table>
i want when user click with shift + mouse click on first row and then last row btw them all rows are selected with the row id ?is this possible to do?
Plz help....
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
