{hero}

language.lengthMenu

Since: DataTables 1.10

Page length options string.

Description

Detail the action that will be taken when the drop down menu for the pagination length option is changed. The token _MENU_ is replaced with a default select list of 10, 25, 50 and 100 (or any other value specified by lengthMenu), and can be replaced with a custom select list if required.

Type

This option can be given in the following type(s):

Default

  • Value: Show _MENU_ entries

Examples

Language change only:

$('#example').dataTable( {
  "language": {
    "lengthMenu": "Display _MENU_ records"
  }
} );

Language and options change (you'd be better off useing lengthMenu though!:

$('#example').dataTable( {
  "language": {
    "lengthMenu": 'Display <select>'+
      '<option value="10">10</option>'+
      '<option value="20">20</option>'+
      '<option value="30">30</option>'+
      '<option value="40">40</option>'+
      '<option value="50">50</option>'+
      '<option value="-1">All</option>'+
      '</select> records'
  }
} );

Related

The following options are directly related and may also be useful in your application development.