fnGetNodes and fnGetData doesn't return all rows data from a datatable.

fnGetNodes and fnGetData doesn't return all rows data from a datatable.

maninareshkumarmaninareshkumar Posts: 2Questions: 0Answers: 0
edited March 2013 in DataTables 1.9
Hi,

I have a datatable setup which has totally 13 records to display, the first page displays 6 rows and the second page displays 6 rows and third...

1. With click of a button i am calling

var rows = oTable.fnGetNodes();
alert(rows.length);

The alert is displaying 6 instead of 13 - Is this a bug, i even tried using bDeferRender - true or false nothing happens.

2. With click of a button i am calling

for (var i = 0; i <= userTable.fnSettings().fnRecordsTotal() - 1; i++) {

var aData = userTable.fnGetData(i);
alert(aData["DT_RowId"]);
}

The alert displays the first 6 records, and from 7th record on wards it says undefined.

Please advice what i am doing wrong here.

Cheers
Naresh

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Link to a test case please: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Allan
  • maninareshkumarmaninareshkumar Posts: 2Questions: 0Answers: 0
    Hi Allan

    I don't have a test case i am a very beginner in using the datatables. I forgot to mention the data coming into the datatables is from server-side processing. I realized this might be the problem. But i don't how to fix this. Do you have any working example of my situation using server-side processing.

    Thanks
    Naresh
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > I forgot to mention the data coming into the datatables is from server-side processing.

    That is indeed the problem. The whole point of server-side processing is that not all of the data is at the client - it is at the server. If you want all of the data and the client-side, use client-side processing :-).

    Allan
This discussion has been closed.