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?

Gyrocode.com
  • 57,606
  • 14
  • 150
  • 185
Brian Powell
  • 3,336
  • 4
  • 34
  • 60

2 Answers2

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.

Gyrocode.com
  • 57,606
  • 14
  • 150
  • 185
  • 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! – Brian Powell Jan 21 '16 at 19:57
  • 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. – Brian Powell Jan 21 '16 at 21:00
  • 1
    @BrianPowell, Submit button is part of HTML code, see [corresponding jsFiddle](https://jsfiddle.net/gyrocode/snqw56dw/). – Gyrocode.com Jan 21 '16 at 21:39
  • @Gyrocode.com sorry for "hijacking" the question, but if you could take a look at this https://stackoverflow.com/questions/72722463/datatables-checkboxes-extension-combined-with-sortable I'd be really grateful!!! – Faye D. Jun 22 '22 at 22:02
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

Brian Powell
  • 3,336
  • 4
  • 34
  • 60