{hero}

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 the pageLength table control feature, giving the end user to change the number of records to be shown per page.

As of DataTables 2, the position of the information display is defined by the layout option, which can also be used to disabled the feature or provide extra configuration for it.

In legacy 1.x installs, the dom option can be used to position the element along with some 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 affected.

Additionally, if pagination is disabled using the paging option, this option is automatically disabled since it has no relevance when there 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:

new DataTable('#myTable', {
	lengthChange: false
});

Related

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