jquery datatable checkall problem

jquery datatable checkall problem

LaithLaith Posts: 5Questions: 0Answers: 0
edited June 2011 in DataTables 1.8
HTML






field
field
field
field
field





value
value
value
value
value




i'm trying to make the checkall checkbox selects all the checkboxs using this code

$('.checkall').click(function () {
var checkall =$(this).parents('.box:eq(0)').find(':checkbox').attr('checked', this.checked);
$.uniform.update(checkall);
});

as datatable shows the first 10,20,30 ... etc rows and removes the others from the DOM to do the pagination, this jquery code only selects the rows in the current page. so is there anyway that i can select all checkboxs ?

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Was there a reason to post the same thread three times? Did the forum "hiccup" or something? I've deleted the two duplicates.

    You want the API method fnGetNodes: http://datatables.net/api#fnGetNodes

    [code]
    $('.checkall', oTable.fnGetNodes()).click(function () {
    [/code]

    Allan
  • LaithLaith Posts: 5Questions: 0Answers: 0
    Hello Allan
    That was awesome it's 100% working now.

    for multiple posts i couldn't post the topic using Chrome after clicking Submit button nothing happened. i'm using Chrome 12.0.742.91, windows 7. hope that i helped

    i used firefox and it worked out.
  • LaithLaith Posts: 5Questions: 0Answers: 0
    P.S i'm having the same problem on posting comments too. as i see the comment is posted but the page didn't change. i'm on firefox now
This discussion has been closed.