jQuery dataTables hide Show Entries text but show the dropdown list

use*_*950 4 datatables

jQuery dataTables hide "Show Entries" text but show the dropdown list in right side of page.

$('#myTable_reports_view').DataTable({
   "aoColumnDefs": [
       {"bSortable": false, "aTargets": [2,3,4,5,7]}
   ],
   "bFilter": false,
   "bInfo": false,
   "bLengthChange": true
});
Run Code Online (Sandbox Code Playgroud)

I am adding this code. The problem is "Show DDL entries" is getting hide but I want to hide the text part only, not the dropdown list.

dav*_*rad 11

是的,隐藏长度菜单会隐藏文本长度菜单.如果您只想删除" 显示XX条目 "文本,则只需更改该特定元素的语言设置即可.默认设置为:

"oLanguage": {
    "sLengthMenu": "Show _MENU_ entries"
}
Run Code Online (Sandbox Code Playgroud)

在初始化时重置:

$('#myTable_reports_view').DataTable({
   "bFilter": false,
   "bInfo": false,
   "bLengthChange": true,
   oLanguage: {
       sLengthMenu: "_MENU_",
    }
});
Run Code Online (Sandbox Code Playgroud)

现在您只有下拉列表,而不是前缀/后缀.以下是所有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"
 }
Run Code Online (Sandbox Code Playgroud)