Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename "show XX entries" drop down in DataTables

In DataTables is there any way to rename the Show ___ Entries drop down text? Specifically, I have a client who wants to change "Show" to "Display". If memory serves, this is generated by the lengthMenu item, but while I see how to customize the select box options I haven't found any way to change the label.

UPDATE: here is my relevant code.

$("#datatable").dataTable( {
  bFilter: false,
  "sDom": 'lfptip',
  "oLanguage": {
    "sLengthMenu": "Display _MENU_ records",
  }
  "aoColumnDefs": [{ "bSortable": false, "aTargets": [ 9 ] }, { sType: 'datetime-us-flex', aTargets: [0, 4] }, { sType: 'numeric-empty-bottom', aTargets: [7, 8] },
    { "sClass": "col-strong", "aTargets": [ 1 ] }
  ],
});
like image 297
Sean Cunningham Avatar asked Jan 05 '15 22:01

Sean Cunningham


2 Answers

You can use this

$('#example').dataTable( {
    "oLanguage": {
      "sLengthMenu": "Display _MENU_ records",
    }
});

from https://datatables.net/docs/DataTables/1.9.beta.1/DataTable.defaults.oLanguage.html#sLengthMenu_details

like image 134
ivg Avatar answered Nov 02 '22 08:11

ivg


$('#example').dataTable( {
    "oLanguage": {
      "sLengthMenu": "Your words here _MENU_ and/or here",
    }
});

Demo | Docs

like image 37
isherwood Avatar answered Nov 02 '22 09:11

isherwood