[server side] get number of rows
[server side] get number of rows
Dear all!
I get some data via server side:
[code]
oTable = $('#oxarticles').dataTable({
"bProcessing": true,
"sAjaxSource": 'bin/dcut_get_list.php',
...
});
[/code]
Now I want to know, how many rows there are. The reply of the server contains iTotalRecords, but I don't get this number either by calling oTable.fnGetData().length or oTable.fnSettings().fnRecordsTotal().
[code]
console.log("Length: " + oTable.fnGetData().length);
console.log("Length: " + oTable.fnSettings().fnRecordsTotal());
// output:
Length: 0
Length: 0
[/code]
So, how do I get the number of rows using server side? Do I need to call the script again and manually evaluate the field iTotalRecords?
I get some data via server side:
[code]
oTable = $('#oxarticles').dataTable({
"bProcessing": true,
"sAjaxSource": 'bin/dcut_get_list.php',
...
});
[/code]
Now I want to know, how many rows there are. The reply of the server contains iTotalRecords, but I don't get this number either by calling oTable.fnGetData().length or oTable.fnSettings().fnRecordsTotal().
[code]
console.log("Length: " + oTable.fnGetData().length);
console.log("Length: " + oTable.fnSettings().fnRecordsTotal());
// output:
Length: 0
Length: 0
[/code]
So, how do I get the number of rows using server side? Do I need to call the script again and manually evaluate the field iTotalRecords?
This discussion has been closed.
Replies
Allan