How to Select All Checkbox not Existing in current "DOM"

How to Select All Checkbox not Existing in current "DOM"

Sageis1Sageis1 Posts: 53Questions: 9Answers: 0

Hello all,

The current solution contains a select all button that is suppose to "Check" all rows in the table, i noticed that the java-script below does select all rows, but not on the other "pages", only in the current page

$('#selectAll').click(function (e) {

                var checkBoxes = document.getElementById('datatables').querySelectorAll('input[type=checkbox]');

                if ($(this).hasClass('checkedAll')) {

                    $(checkBoxes).prop('checked', false);
                    $(this).removeClass('checkedAll');
                } else {
                    $(checkBoxes).prop('checked', true);
                    $(this).addClass('checkedAll');
                }
            });

Then i can across an SO article on how non visible rows dont exist in the DOM.

So my Question is how to Select All rows both non visible and visible.

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.