how to add Check all in datatable

how to add Check all in datatable

GuruGuru Posts: 8Questions: 0Answers: 0
edited February 2011 in General
I searched in forums but didnt find exact solution for this.
On i want to add check all functionality, on all pages. And on click of button want to retrieve all value of checked items.
Can anyone guide me how to do it in simplest way to do Check all option in datatable?

Replies

  • GuruGuru Posts: 8Questions: 0Answers: 0
    Guys
    any solutions????
  • jimhapjimhap Posts: 4Questions: 0Answers: 0
    I use the TableTools plugin with the fnSelectAll and fnUnselectAll. I've only implemented the default functionality (click row to select vs a checkbox) but I imagine you can apply the selected status of any row to checkbox during fnRowCallback.

    HTH, jim
  • GuruGuru Posts: 8Questions: 0Answers: 0
    Thanks jim for quick reply.
    Can you provide me sample link or docs for same?

    Thanks once again.
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Here is the TableTools example Jim mentioned: http://datatables.net/release-datatables/extras/TableTools/select_multi.html

    Failing that - if you want to just check checkboxes, you can use standard jQuery stuff, with fnGetNodes. Something like:

    [code]
    $('td input', oTable.fnGetNodes()).attr('checked', 'checked');
    [/code]

    Allan
  • GuruGuru Posts: 8Questions: 0Answers: 0
    Thanks Allan.
    i will try and let you know.
This discussion has been closed.