1
我希望我的數據表每頁顯示50行。Datatable只顯示10行,當50問
我試圖設置它:bLengthChange:true和pageLength:50但它沒有工作。
在一個理想的世界,我也想擺脫bLengthChange的 - >假的,讓我不明白的組合選擇多少行做我想做...
這裏是我的代碼。
<html><body>
<head>
<link rel="stylesheet" href="//cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css">
</head>
<body>
<table class="table responsive table-togglable table-hover">
<thead>
<tr>
<th data-toggle="true">ID</th>
<th >Usuario</th>
<th >Objeto</th>
<th >Id del Objeto</th>
<th class="none">Antes</th>
<th class="none">Despues</th>
<th >type</th>
<th >Creación</th>
<th >Actualización</th>
</tr>
</thead>
<tbody>
<tr>
<td>2165</td>
<td> - </td>
<td>PersonReferences</td>
<td>3802973</td>
<td> - </td>
<td> Large Text </td>
<td>created</td>
<td>2016-05-11 17:07:23</td>
<td>2016-05-11 17:07:23</td>
</tr>
</tbody>
</table>
<script src="http://rh.dev/assets/materialize/js/jquery-1.11.2.min.js"></script>
<script src="http://rh.dev/assets/js/datatables/datatables.min.js"></script>
<script src="http://rh.dev/assets/js/datatables/extensions/responsive.min.js"></script>
<script>
$('.table-togglable').DataTable({
bLengthChange: true,
pageLength: 50,
bInfo: false,
responsive: true,
"bAutoWidth": false,
});
</script>
任何想法?
嗨再次!!!你的小提琴可以工作,但我再一次不工作。要更改pageLength的組合不起作用。 (10,50,100),但排序和過濾器正在工作。 –
@JuliatzindelToro嘗試添加'「lengthMenu」' – CMedina
它將條目添加到組合,但仍然不工作:( –