Showing 1 to NaN of NaN entries, server side mode
Showing 1 to NaN of NaN entries, server side mode
hi
i do a call on the server, i use server side paging.
my init
[code]
$('#tableExample').dataTable({
"bProcessing": true,
"sPaginationType": "full_numbers",
"bLengthChange": false,
"bSort": true,
"bInfo": true,
"iDisplayLength": 10,
"bPaginate": true,
"bAutoWidth": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"sAjaxSource": 'test.html'
});
[/code]
my result
[code]
{
"sEcho": 1,
"iTotalRecords": 4,
"iTotalDisplayRecords": 4,
"aaData": [
[
"Gecko",
"Firefox 1.0",
"Win 98+ / OSX.2+",
"1.7",
"A"
],
[
"Gecko",
"Firefox 1.5",
"Win 95+ / OSX.2+",
"1.4",
"A"
],
[
"Gecko",
"Firefox 1.6",
"Win 98+ / OSX.2+",
"1.8",
"A"
],
[
"Gecko",
"Firefox 1.7",
"Win 98+ / OSX.2+",
"1.8",
"A"
]
]
}
[/code]
the data is displaybed but i get
Showing 1 to NaN of NaN entries (filtered from 4 total entries) to the left of the table and for the paging: First Previous 1 2 3 4 5 Next Last
thanks
i do a call on the server, i use server side paging.
my init
[code]
$('#tableExample').dataTable({
"bProcessing": true,
"sPaginationType": "full_numbers",
"bLengthChange": false,
"bSort": true,
"bInfo": true,
"iDisplayLength": 10,
"bPaginate": true,
"bAutoWidth": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"sAjaxSource": 'test.html'
});
[/code]
my result
[code]
{
"sEcho": 1,
"iTotalRecords": 4,
"iTotalDisplayRecords": 4,
"aaData": [
[
"Gecko",
"Firefox 1.0",
"Win 98+ / OSX.2+",
"1.7",
"A"
],
[
"Gecko",
"Firefox 1.5",
"Win 95+ / OSX.2+",
"1.4",
"A"
],
[
"Gecko",
"Firefox 1.6",
"Win 98+ / OSX.2+",
"1.8",
"A"
],
[
"Gecko",
"Firefox 1.7",
"Win 98+ / OSX.2+",
"1.8",
"A"
]
]
}
[/code]
the data is displaybed but i get
Showing 1 to NaN of NaN entries (filtered from 4 total entries) to the left of the table and for the paging: First Previous 1 2 3 4 5 Next Last
thanks
This discussion has been closed.
Replies
Allan
"sAjaxSource": "/examples/server_side/scripts/server_processing.php",
don't seem to work
There are some pre-built Ajax loading examples for live.datatables.net detailed and linked to here: http://next.datatables.net/manual/tech-notes/9#Ajax-loaded-data .
Allan
Allan
anyway i get data
i commented it in my code and that worked a little bit better, paging bar stopped to display 1, 2, 3 ...
but i continue to see: Showing 1 to NaN of NaN entries (filtered from 4 total entries)
i'm using datatable 1.9.4
so a part of problem seem to be the dataTables.bootstrap.js
can't log or create a new account on http://live.datatables.net/
and changed
sEcho by draw:
iTotalRecords" by recordsTotal
iDisplayRecords by recordsFiltered
aaData by data
and the Showing 1 to NaN of NaN entries problem is resolved
so i tried with to use: "sPaginationType": "bootstrap",
but i get
Cannot call method 'fnInit' of undefined
jquery.dataTables.js:3163
Allan
can't log on live.datables.net so i post the code here
[code]
// Server-side processing with POST
$(document).ready(function() {
$('#example').dataTable( {
"sPaginationType": "bootstrap",
"bProcessing": true,
"bLengthChange": true,
"bSort": true,
"bInfo": true,
"iDisplayLength": 10,
"bPaginate": true,
"bAutoWidth": true,
"bServerSide": true,
"sDom": '<"#thead"f>tipr',
"ajax": "/ssp/objects.php",
"aoColumns": [
{ "sTitle": "Firstname", "mData": "first_name" },
{ "sTitle": "Lastname", "mData": "last_name" },
{ "sTitle": "Position", "mData": "position" },
{ "sTitle": "Office", "mData": "office" },
{ "sTitle": "Start date", "mData": "start_date" },
{ "sTitle": "Salary", "mData": "salary" }
]
} );
} );
[/code]
[code]
<!DOCTYPE html>
DataTables - JS Bin
Name
Position
Office
Age
Start date
Salary
Name
Position
Office
Age
Start date
Salary
[/code]
with this code in http://live.datatables.net/
i got: Uncaught TypeError: Cannot call method 'fnInit' of undefined