开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜