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

checkbox - Select checkboxes all only works once?

$
0
0
Im using a checkbox in the table header to select (or unselect) all checkboxes in that column. Im new to JQuery.

Code in script (Run from inside $(document).ready(function() {)....

$('#check_all').click( function() {
$('input', oTable.fnGetNodes()).attr('checked',this.checked);
} );

This code works perfectly but only once! I can click it and select all AND then i can click it and it will unselect all. However from then on i click it and nothing happens.

When i chuck a console.log("Check event hit"); into the script it fires every time.. yet it only updates the checkboxes for the first check and uncheck operations.

Any thoughts?

Matt

Viewing all articles
Browse latest Browse all 82109

Trending Articles



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