DataTables 1.10 Select All checkbox and Hidden rows/pages

DataTables 1.10 Select All checkbox and Hidden rows/pages

jsmoorejrjsmoorejr Posts: 3Questions: 2Answers: 0

I am new to DataTables and have a table with a "Select All" checkbox in the table header row and then each row has a checkbox. I can write code to select all of the visible checkboxes when the "Select All" checkbox is checked, but if there are other pages, those are not getting checked.

I have followed several examples, but none of them seem to work, at least I cannot get them to work. One was on StackOverflow and it seems to be the closest thing to what I am looking for. However, I have attempted to make this work and I am just stuck.

My example code can be found on the DataTables Live site. Does anyone have any ideas?

Answers

  • jsmoorejrjsmoorejr Posts: 3Questions: 2Answers: 0

    There are a couple mistakes in the jQuery example I posted, so I have simplified it here: DataTables Live Updated Example. All I want to do at the moment is get all checkboxes on every Page, to be checked when you check the "Select All" checkbox. Until I can get past that, I can't add up the total due.

  • genargenar Posts: 1Questions: 0Answers: 0

    I was looking the same.

    this worked for me:

            $('#select_all_existent').change(function(){
                var cells = table.cells( ).nodes();
                $( cells ).find(':checkbox').prop('checked', $(this).is(':checked'));
            });
    
This discussion has been closed.