I have a datatable :
$(document).ready (function() {
$('#table_list').DataTable ({
"bJqueryUI": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "./action/list_json.php",
"iDisplayLength": 50, // default nb to display
"aaSorting": [],
"oLanguage": {
"sLengthMenu": 'Show <select id="list"><option value="25">25</option><option value="50">50</option><option value="100">100</option></select> lines'
},
"aoColumns": [
{ "bVisible":false }, { "bSortable":false }, { "bSortable":false }, { "bSortable":false }, { "bSortable":false }
]
});
}) ;
After changing the number of lines to display per page my back return good information :
....
"iTotalRecords" => "28"
"iTotalDisplayRecords" => 25
But in view I have a pagination with page 1 activated, normally I should have a pagination with 2 pages : 25 items on first page and 3 items on the second;
But I have something like:
The problem is that rendering of pagination is not done. What can I try next?
1条答案
按热度按时间brc7rcf01#
you need to add below two attributes in datatable configuration
your code should look like
NOTE: use
"pagingType": "full_numbers"
if"sPaginationType":"full_numbers"
does not work. It depends on your datatable plugin version