pageLength
Paging length control.
Description
This feature displays a select
dropdown that will change the page length used by the DataTable, along with a descriptive label. The select
let's the end user select how many records should be shown per page.
The pageLength
feature can be disabled completely using the lengthChange
or paging
options or by excluding it from the layout
options (which is the preferred method as of DataTables 2).
Examples
Disable page length control with default layout:
new DataTable('#myTable', {
layout: {
topStart: null
}
});
Show page length control bottom left of the table:
new DataTable('#myTable', {
layout: {
bottomStart: 'pageLength',
topStart: null
}
});
Show page length control with options:
new DataTable('#myTable', {
layout: {
topStart: {
pageLength: {
menu: [5, 10, 25, 50]
}
}
}
});
Related
The following options are directly related and may also be useful in your application development.