Length Menu
Length Menu
How do you add the length menu to the Editor DataTables:
$('#datatable-table').DataTable( {
dom: "Bfrtip",
pageLength: 25,
lengthMenu: [ 25, 50, 75, 100, "All" ],
ajax: {
url: "../../server/admin_data.php",
type: "POST"
},
serverSide: true,
columns: [
{ data: "clli" },
{ data: "address" },
{ data: "iris" },
{ data: "client_name" },
{ data: "fic_bay" },
{ data: "panel" },
{ data: "jack_number" },
{ data: "reserved_by" },
{ data: "notes" }
],
select: true,
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]
} );
} );
The Length Menu is not displaying.
This question has accepted answers - jump to:
Answers
You may have to use
<clear>
in yourdom
, for example:dom: 'B<clear>frtip',
Kevin
Its the
l
option indom
.See also the How can I show the page length select when using Buttons FAQ .
Allan
Adding the "l" option to the "dom" definitely did the trick, however, I still get an error when add "All".
You need to use -1 for all. Have a look at the examples in the
lengthMenu
which show how to use -1 with a language option.Allan