Checkall - using Ajax, not all rows returned

Checkall - using Ajax, not all rows returned

kevindkevind Posts: 3Questions: 0Answers: 0
edited August 2009 in General
Hi,

I'm almost there, but have one last stumbling block...

In my DataTable I have a checkbox for each row. When the checkbox is ticked, I write the value to a hidden field, so when I paginate through the results, the fact that a checkbox was ticked is remembered.

However, I need to offer a 'check all' tickbox which, when ticked ticks the checkbox for all rows in the dataset - including those not appearing on screen.

Somehow I need to populate my hidden field with a string of all the checkboxes that appear in the currently filtered list, and then call fnDrawCallback to tick the boxes that appear in that string (that part is already written).

Am I approaching this in the right way? Can someone please give me a kick in the right direction?

Many thanks for your help...
Kev

Replies

  • fliesflies Posts: 35Questions: 0Answers: 0
    edited August 2009
    afaik all rows all numbered from 0-length of rows, so just create array of indexes and put into hidden field

    Another approach is to create a hidden column which takes 1 or 0 depending if checked or just fnUpdate all rows and put the checked marker in that column.
This discussion has been closed.