lengthChange

Since: DataTables 1.10

Feature control the end user's ability to change the paging display length of the table.

Description

When pagination is enabled, this option will control the display of an option for the end user to change number of records to be shown per page. The options shown in the list are controlled by the lengthMenu configuration option.

Note that by default the control is shown at the top left of the table. That can be controlled using dom and CSS.

If this option is disabled (false) the length change input control is removed - although the page.len() method can still be used if you wish to programmatically change the page size and pageLength can be used to specify the initial page length. Paging itself is not effected.

Additionally, if pagination is disabled using the paging option, this option is automatically disabled since it has no relevance when the is no pagination.

Type

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

Default

  • Value: true

Example

Disable user ability to change number of records per page:

$('#example').dataTable( {
  "lengthChange": false
} );

Related

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