Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show all rows by default in JQuery DataTable

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]     }); 
like image 469
Radislav Avatar asked Feb 25 '12 11:02

Radislav


People also ask

How do I show only 5 records in a Datatable?

There is a option called pageLength . You can set this for show only 5 entries.

What is Bfrtip Datatable?

The B is the Buttons extension and it tell DataTables where to put each element in the DOM that it creates.


1 Answers

Use:

$('#example').dataTable({     aLengthMenu: [         [25, 50, 100, 200, -1],         [25, 50, 100, 200, "All"]     ],     iDisplayLength: -1 }); 

Or if using 1.10+

$('#example').dataTable({     paging: false }); 
like image 176
LCoelho Avatar answered Sep 28 '22 10:09

LCoelho