Jquery DataTable 一次显示所有或 50 条记录,在 Metronic 管理主题中没有任何分页
Jquery DataTable display all OR 50 Records at once without any pagination in Metronic admin theme
我已经在我的 HTML 文件下以这种方式配置了 table
<table class="table table-striped table-bordered table-hover table-full-width" id="sample_2">
<thead>
<tr>
<th class="hidden-480">BuySell Difference</th>
<th class="hidden-480">Stock</th>
<th class="hidden-480">LP</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
我在 table_managed.js 文件下有这个东西
$('#sample_2').dataTable({
"aLengthMenu": [
[5, 15, 20, -1],
[5, 15, 20, "All"] // change per page values here
],
// set the initial value
"iDisplayLength": 5,
"sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ per page",
"oPaginate": {
"sPrevious": "Prev",
"sNext": "Next"
}
},
"aoColumnDefs": [{
'bSortable': false,
'aTargets': [0]
}
]
});
现在它最初只显示前 10 条记录。当我 select ALL 在下拉列表下时它显示所有记录。
How can i make display all records at once without any pagination initially??
尝试将 "iDisplayLength": 5
更改为 "iDisplayLength": -1
我已经在我的 HTML 文件下以这种方式配置了 table
<table class="table table-striped table-bordered table-hover table-full-width" id="sample_2">
<thead>
<tr>
<th class="hidden-480">BuySell Difference</th>
<th class="hidden-480">Stock</th>
<th class="hidden-480">LP</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
我在 table_managed.js 文件下有这个东西
$('#sample_2').dataTable({
"aLengthMenu": [
[5, 15, 20, -1],
[5, 15, 20, "All"] // change per page values here
],
// set the initial value
"iDisplayLength": 5,
"sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ per page",
"oPaginate": {
"sPrevious": "Prev",
"sNext": "Next"
}
},
"aoColumnDefs": [{
'bSortable': false,
'aTargets': [0]
}
]
});
现在它最初只显示前 10 条记录。当我 select ALL 在下拉列表下时它显示所有记录。
How can i make display all records at once without any pagination initially??
尝试将 "iDisplayLength": 5
更改为 "iDisplayLength": -1