fnGetNodes and fnGetData doesn't return all rows data from a datatable.
fnGetNodes and fnGetData doesn't return all rows data from a datatable.
maninareshkumar
Posts: 2Questions: 0Answers: 0
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
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
This discussion has been closed.
Replies
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
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