Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82266

Adding dynamic checkboxes to the header of a table

$
0
0
Hi. I've seen other questions similar to this but they don't answer my questions.

You can see here I'm using the "sDom" to add some html to my header. Also I'm using jQueryUI so I need to use "H" and "F" to get my pretty styling.

$(document).ready(function() {
  $('table.display').dataTable( {
    "bJQueryUI": true,
    "sDom": '<"H"lfr<"toolbar">>t<"F"ip>'
});
  $("div.toolbar").html('want checkbox');
});

What I'd like to know is two things:

1: How do I use javascript to add checkboxes (is there a better way than .html)
2: Really I would like to add these checkboxes in my "html" file itself (where the <table> is defined. How can I do this in such a way that I can define the checkboxes in my html and have them included in the table header?

Thank you!

Viewing all articles
Browse latest Browse all 82266

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>