是的,隐藏长度菜单会隐藏文本和长度菜单。如果您只是想摆脱“显示 XX 条目”文本,那么只需更改该特定元素的语言设置即可。默认设置是:
"oLanguage": {
"sLengthMenu": "Show _MENU_ entries"
}
在初始化时重置它:
$('#myTable_reports_view').DataTable({
"bFilter": false,
"bInfo": false,
"bLengthChange": true,
oLanguage: {
sLengthMenu: "_MENU_",
}
});
现在您将只有下拉菜单,而不是前缀/后缀。这是所有oLanguage 默认值的提取列表:
"oLanguage": {
"oAria": {
"sSortAscending": ": activate to sort column ascending",
"sSortDescending": ": activate to sort column descending"
},
"oPaginate": {
"sFirst": "First",
"sLast": "Last",
"sNext": "Next",
"sPrevious": "Previous"
},
"sEmptyTable": "No data available in table",
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
"sInfoEmpty": "Showing 0 to 0 of 0 entries",
"sInfoFiltered": "(filtered from _MAX_ total entries)",
"sInfoPostFix": "",
"sDecimal": "",
"sThousands": ",",
"sLengthMenu": "Show _MENU_ entries",
"sLoadingRecords": "Loading...",
"sProcessing": "Processing...",
"sSearch": "Search:",
"sSearchPlaceholder": "",
"sUrl": "",
"sZeroRecords": "No matching records found"
}