Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DataTables - I don't want the search/filter and length options on some tables

How do I initialise specific tables without the search filter and length select menu?

Apparently it can be done with the sDom option, but the documentation is pretty bad and I can't understand exactly what I am supposed to do.

http://datatables.net/usage/options#sDom

like image 537
BadHorsie Avatar asked Nov 13 '12 10:11

BadHorsie


People also ask

How do I remove search and show entries in DataTable?

To disable the "Show Entries" label, use "bInfo", example: "bFilter" is the search component, but are active by default. $(document). ready( function () { $('#example'). dataTable( { "bInfo": false } ); } );

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.

How can we change width of search fields in DataTables?

ready(function () { $('. dataTables_filter input[type="search"]'). css( {'width':'350px','display':'inline-block'} ); }); And it worked perfectly!


1 Answers

You can set to false such properties during initialization of datatable:

"bFilter" : false,                "bLengthChange": false 
like image 142
Smiter Avatar answered Sep 25 '22 01:09

Smiter