Click here to Skip to main content
15,071,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Guys,

I am using a data table to show the grid. There is select all option to select multiple records.
My problem is when I selectAll it will select all records even if searched for particular

What I have tried:

My Datatable:
oTableCompletedAppt = $('#consignmentnote').dataTable({
            "language": {
                "emptyTable": "-",
                "paginate": {
                    "previous": "<",
                    "next": ">"
            "searching": true,
            "lengthChange": true,
            "info": true,
            "ordering": true

Select All function:

$("#selectAll").on("change", function () {
                if ($('#selectAll').is(":checked")) {
                    oTableCompletedAppt.$("input[type='checkbox']").attr('checked', $(this.checked));
                else {
                    oTableCompletedAppt.$("input[type='checkbox']").attr('checked', false);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900