0

I hope this is something I just overlooked, but I'm trying to capture the checkbox click or change event on a row of a DataTables table. The use case is that I want to enable a link on the page if any row is selected, and disable the link if no rows are selected. So I need some sort of a change event that happens when the checkbox is selected or deselected, but I'm not having any luck. I can see how to find out how many rows are selected inside of a function, but I need a trigger event.

I tried doing this with the Select extension for DataTables, but I couldn't seem to get what I wanted there, either.

Thanks!

awthird
  • 67
  • 4
  • 1
    [edit] and create a [mcve]. Read [ask]. – Roko C. Buljan Nov 19 '21 at 17:09
  • You said you tried this, can you please provide the minimal reproducible code? – BeerusDev Nov 19 '21 at 20:05
  • Thanks. I figured it out in the interim using the DataTables Select extension. The key was to use the 'select' event on the defined table (ie, var table = $('#table-id').DataTables(...), rather than on the element id itself. – awthird Nov 19 '21 at 20:20

0 Answers0