1

I've successfully integrated the DataTables Checkbox option into my page, but I can't find anything on how to actually UTILIZE these once they're in. Since they don't use <input> to create these and rely on CSS :before and :after, I'm not sure how I get the checkboxes to do something when I click them.

Is there any documentation on this that I just can't find?

2 Answers 2

1

You can use API methods such as rows({ selected: true }) or cells({ selected: true }) to get selected entities.

See our article jQuery DataTables – Row selection using checkboxes and Select extension or this jsFiddle for advanced example on how to use checkboxes for row selection with jQuery DataTables and Select extension.

Sign up to request clarification or add additional context in comments.

4 Comments

wow - January 16th? I just made the mark :) The additional code you show on here for the Submit button was absolutely wonderful, and the entire tutorial is laid out really well. Thanks so much!
This works really well - the only thing I can't figure out is how you enabled the submit button. In your JQuery code, you have this $('#frm-example').on('submit', function(e){, but I don't see anywhere where you're adding this button to the code, either through DataTables itself, or through the HTML section of your code.
@BrianPowell, Submit button is part of HTML code, see corresponding jsFiddle.
@Gyrocode.com sorry for "hijacking" the question, but if you could take a look at this stackoverflow.com/questions/72722463/… I'd be really grateful!!!
0

I found where this is on the Datatables site:

https://datatables.net/extensions/select/

and

https://datatables.net/extensions/select/examples/api/get.html

Comments

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.