开发者

when i click check all all the records is selected even in the next page records(in javascript table)

开发者 https://www.devze.com 2023-02-13 04:28 出处:网络
I am showing checkbox,article title,description,status in table(using javascript table which as sorting etc)

I am showing checkbox,article title,description,status in table(using javascript table which as sorting etc)

when i have 20 records,the table display 10 records per page,when i cl开发者_开发知识库ick checkall all the records selected i.e the 2 page records also selected...

i want to be like this ,when i click checkall one the page showing should be checked...

how to do that in javascript?

my script to checkall is this

function Checkall(){
    $("INPUT[type='checkbox']").each(function(){
        if (this.checked == false) {
            //$("INPUT[type='checkbox']").attr('checked', this.checked);
            this.checked = true;
            $("#checkall").val("UnCheck All");
        } else {
            this.checked = false;
            $("#checkall").val("Check All");
        }
    });
} 


Try this:

$("INPUT[type='checkbox']:visible")

to select only visible check boxes

0

精彩评论

暂无评论...
验证码 换一张
取 消