遇到数据表的分页问题。所有数据显示在单个页面中。如何将行数限制为10?
JS代码:
$(document).ready(function() {
$.ajax({
url : 'views/logs/reldata.php' ,
// type : "GET";
success : function(data)
{
// alert(data);
$("#media_tbl").empty();
$('#media_tbl').DataTable( {
'searching': true,
"destroy": true,
"processing": true,
"serverSide": true,
"paging": true,
"length": 10,
"ajax" : 'views/logs/reldata.php',
"columns": [
{ "data": "act_type" },
{ "data": "action" },
{ "data": "actor" },
{ "data": "date_created" }
]
});
// setInterval( function () {
// $('#media_tbl').DataTable().ajax.reload();
// }, 30000 );
}
});
});
PHP代码:
$dispo = array(
'draw' => 9,
'recordsTotal' => (int)$coun['cou'],
'recordsFiltered' => (int)$coun['cou'],
'data' => $disp
);
$dispo = json_encode($dispo);
print $dispo;
遇到数据表的分页问题。所有数据显示在单个页面中。如何将行数限制为10? 谢谢您的帮助:D