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!

3
  • 1
    edit and create a minimal reproducible example. Read How to Ask. Commented Nov 19, 2021 at 17:09
  • You said you tried this, can you please provide the minimal reproducible code? Commented Nov 19, 2021 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. Commented Nov 19, 2021 at 20:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.