I have a DataTable with the following columns:
const columns = [
{ name: "Matric",
selector: "matric",
sortable: true
},
{
name: "Forename",
selector: "forename",
sortable: true
},
{
name: "Surname",
selector: "surname",
sortable: true
}
]
<DataTable
pagination
selectableRows
columns = {columns}
data = {studentData}
defaultSortField="matric"
/>
SelectableRows adds a checkbox to each row. I'm using the datatable to take attendance but I was hoping to also allow the user to upload the attendance via a .csv, or if an attendance record already exists it will display it in the datatable.
By uploading the csv or fetching the attendance record, I'm hoping that the datatable will rerender with the respective rows checked so the user can double check. But I'm not sure how to select a row on render.
Any help would be great!