Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

check box all in jequery data table

$(document).ready(function () { 
    var oTable = $('#example').dataTable({
        stateSave: true
    });

    var allPages = oTable.fnGetNodes();

    $('body').on('click', '#selectAll', function () {
        if ($(this).hasClass('allChecked')) {
            $('input[type="checkbox"]', allPages).prop('checked', false);
        } else {
            $('input[type="checkbox"]', allPages).prop('checked', true);
        }
        $(this).toggleClass('allChecked');
    })
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to add two elements in one path in react router v6 
Javascript :: js date subtract days 
Javascript :: (node:63208) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead 
Javascript :: jquery clear form values 
Javascript :: express search query template 
Javascript :: nl2br in jquery 
Javascript :: object to query string js 
Javascript :: create a category discord.js 
Javascript :: last position of array javascript 
Javascript :: how to print an array in javascript 
Javascript :: javascript add element above 
Javascript :: remove white spaces 
Javascript :: convert number to string date js 
Javascript :: regex any letter 
Javascript :: how to get contrast from a color using js 
Javascript :: js sort ascendign 
Javascript :: google sign up react npm 
Javascript :: eslint allow console 
Javascript :: Custom jquery validation messages 
Javascript :: how to add a shadow react native 
Javascript :: javascript paragraph count 
Javascript :: url decode in javascript 
Javascript :: read from s3 bucket nodejs 
Javascript :: elasticsearch field not exists 
Javascript :: check if body has class javascript 
Javascript :: jquery vdn 
Javascript :: moment use in angular 
Javascript :: Angular Unit Testing: Observable not returning results 
Javascript :: how to add jquery in js file 
Javascript :: reference error $ is not defined jquery 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =