Does anybody know how to show all rows by default in jQuery datatable?
I have tried this code, but it only shows 10 rows by default.
$("#adminProducts").dataTable({
"aLengthMenu": [100]
});
Does anybody know how to show all rows by default in jQuery datatable?
I have tried this code, but it only shows 10 rows by default.
$("#adminProducts").dataTable({
"aLengthMenu": [100]
});
Use:
Or if using 1.10+
The option you should use is iDisplayLength:
Here is the entire functional javascript for your .html file
If you're using DataTables 1.10+ you can use the data-* attribute in your
<table>
tagdata-page-length="-1"
This assumes you have "-1" defined in your datatable default configuration, such as below
Your javascript becomes simply
$("table").DataTables();
and you're able to customize the display for every table within in the HTML; IE. if you have second, smaller table in the same page that should be limited to 10 rows,<table data-page-length="10">
use 'fnDrawCallback'