Pagination
Pagination
Hello,
Is there anything that I need to do manually to get pagination to work? I thought it happened by default but the pagination controls are not showing in my UI.
Here is page 1 of my data.
[code]
{
"iTotalRecords": 74093,
"iTotalDisplayRecords": 74093,
"aaData": [
[
"2929",
"es-ES",
"Amkert ES",
"Amkert",
"Zanox",
"Yes",
"0",
""
],
[
"3007",
"es-ES",
"AutoEurope ES",
"AutoEurope Spain",
"Tradedoubler",
"Yes",
"0",
""
],
[
"2961",
"es-ES",
"Late Rooms ES",
"Late Rooms",
"Zanox",
"Yes",
"0",
""
],
[
"3295",
"es-ES",
"Brussels Airlines ES",
"brusselsairlines",
"Zanox",
"Yes",
"0",
""
],
[
"3039",
"es-ES",
"Jazztel ES",
"CJM_Jazztel ES (venta)",
"Commission Junction",
"Yes",
"0",
""
],
[
"2993",
"es-ES",
"Expedia ES",
"Expedia",
"Tradedoubler",
"Yes",
"0",
""
],
[
"3327",
"es-ES",
"neumaticos ES",
"neumaticos-online",
"Zanox",
"Yes",
"0",
""
],
[
"2938",
"es-ES",
"PhoneHouse ES",
"PhoneHouse ES",
"Zanox",
"Yes",
"0",
""
],
[
"3016",
"es-ES",
"InterHome SRL ES",
"InterHome SRL",
"Tradedoubler",
"Yes",
"0",
""
],
[
"2970",
"es-ES",
"Zed Spain ES",
"Zed Spain",
"Zanox",
"Yes",
"0",
""
]
]
}
[/code]
Is there anything that I need to do manually to get pagination to work? I thought it happened by default but the pagination controls are not showing in my UI.
Here is page 1 of my data.
[code]
{
"iTotalRecords": 74093,
"iTotalDisplayRecords": 74093,
"aaData": [
[
"2929",
"es-ES",
"Amkert ES",
"Amkert",
"Zanox",
"Yes",
"0",
""
],
[
"3007",
"es-ES",
"AutoEurope ES",
"AutoEurope Spain",
"Tradedoubler",
"Yes",
"0",
""
],
[
"2961",
"es-ES",
"Late Rooms ES",
"Late Rooms",
"Zanox",
"Yes",
"0",
""
],
[
"3295",
"es-ES",
"Brussels Airlines ES",
"brusselsairlines",
"Zanox",
"Yes",
"0",
""
],
[
"3039",
"es-ES",
"Jazztel ES",
"CJM_Jazztel ES (venta)",
"Commission Junction",
"Yes",
"0",
""
],
[
"2993",
"es-ES",
"Expedia ES",
"Expedia",
"Tradedoubler",
"Yes",
"0",
""
],
[
"3327",
"es-ES",
"neumaticos ES",
"neumaticos-online",
"Zanox",
"Yes",
"0",
""
],
[
"2938",
"es-ES",
"PhoneHouse ES",
"PhoneHouse ES",
"Zanox",
"Yes",
"0",
""
],
[
"3016",
"es-ES",
"InterHome SRL ES",
"InterHome SRL",
"Tradedoubler",
"Yes",
"0",
""
],
[
"2970",
"es-ES",
"Zed Spain ES",
"Zed Spain",
"Zanox",
"Yes",
"0",
""
]
]
}
[/code]
This discussion has been closed.
Replies
Could you post your DataTables initialization code?
codingavenue
Note that i have tried adding bPagination: true and that did not help
could there be a bug in the latest version or am I the only one experiencing this?
Below is my initialization code:
[code]
$(document).ready(
function() {
$("#MerchantTable").dataTable(
{
"aaSorting": [[ 2, "asc" ]],
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
nRow.className = aData[5]=="Yes" ? nRow.className : "disabled_row";
return nRow;
},
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/merchants/tabledata/",
"bAutoWidth": true,
"aoColumns": [
{ "bSearchable": false, "bSortable": false },
{ "bSearchable": true, "bSortable": true },
{ "bSearchable": true, "bSortable": true },
{ "bSearchable": true, "bSortable": true },
{ "bSearchable": true, "bSortable": true },
{ "bSearchable": true, "bSortable": true, "bVisible": false },
{ "bSearchable": true, "bSortable": true },
{ "bSearchable": true, "bSortable": true }
]
}
);
}
);
[/code]
"sPaginationType": "full_numbers",
My ajax call returns (the aaData colapsed)
aaData: [[,…], [,…], [,…], [,…], [,…], [,…], [,…], [,…], [,…], [,…], [,…], [,…], [,…], [,…], [,…], [,…], [,…],…]
iTotalDisplayRecords: 1050
iTotalRecords: 1050
sEcho: 0
But only the first page is rendered (it only shows the number 1 - plus the next/previous)
$('#list').dataTable({
"bProcessing" : true,
"bServerSide" : false,
"bInfo": true,
"sPaginationType": "full_numbers",
"iDisplayLength" : 25,
"sAjaxSource" : url ,
...
> sEcho: 0
sEcho should never be 0. See http://datatables.net/usage/server-side
Allan