Problem on the function 'fnPageChange ()'.

Problem on the function 'fnPageChange ()'.

lesmyrmidonslesmyrmidons Posts: 2Questions: 0Answers: 0
edited February 2010 in General
Hello,
Let me explain what I do:
I have a table with more page with checkbox for all lines. I have a button to 'check all' and I have to check every line of every page.

For that, I did this:
[code]var oSettings = oTable.fnSettings ();
oTable.fnPageChange ( 'first'); // first page
var iRowEnd = oSettings.fnRecordsDisplay ();
var iPagingEnd = oSettings._iDisplayStart;
while (iPagingEnd

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi,

    There is an easier way. Something like:

    [code]
    $('.OrderID', oTable.fnGetNodes() ).attr('checked', true);
    [/code]
    would do it - rather than needing to page through each display page. Having said that, there shouldn't ne anything wrong with fnPageChange, particularly since DataTables uses it internally for pagination! I wonder if it's something to do with the loop - only a trace would say though. I'll see if I can test fnPageChange before the next release - but I'd suggest something like the above one liner :-)

    Regards,
    Allan
  • lesmyrmidonslesmyrmidons Posts: 2Questions: 0Answers: 0
    Hello,

    Thank you for your reply.
    It runs on almost all browsers except IE6 (it does not re-check the checkbox at the re-display the first page)

    Again thank you and congratulations for this plugin.
This discussion has been closed.