JQuery dataTables hide "Show records" text but show dropdown

jQuery dataTables hide the Show Records text, but display the dropdown on the right side of the page.

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

      

I am adding this code. The problem is that "Show DDL Entries" is hiding, but I only want to hide the text part and not the dropdown.

+3


source to share


1 answer


Yes, hiding longmenu hides text and length. If you just want to get rid of the "Show XX records" text, just change the language setting for that particular item. Default settings:

"oLanguage": {
    "sLengthMenu": "Show _MENU_ entries"
}

      

reset, which on initialization:



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

      

You will now only have a dropdown, not prefix / suffixes. Here is the extracted list of all oLanguage

by default:

"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"
 }

      

+9


source







All Articles