Deselecting rows in a DataTable using rowgroup

Deselecting rows in a DataTable using rowgroup

salpautisalpauti Posts: 7Questions: 5Answers: 0

I have two datatables, both of which are using rowgroup, on a page.
When a row is selected in the 1st datatable, I'm attempting to clear the selections in the 2nd and vice versa using code below

.on("select", function (e, dt, type, indexes) {
$('#risks').DataTable().row(':eq(0)', {
page: 'current'
}).deselect();
}

Can you please provide guidance on how to deselect rows in a DataTable using rowgroup?

Answers

  • kthorngrenkthorngren Posts: 20,276Questions: 26Answers: 4,765

    Are you trying to clear the selection of all rows or specific rows?

    .row(':eq(0)',

    Looks like you are attempting to clear the selection of the first row on the page, is that correct?

    Please provide a test case showing what you are trying to do. There isn't enough with your code snippet to understand what you have to offer suggestions.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

This discussion has been closed.