Azima
Azima

Reputation: 4141

Remove search box with bFilter still set to True in DataTable

I need to apply custom filtering function in my datatable. For this, I need to set "bFilter": true. But I don't need search box. How can I do that?

var holiday_filter = $('#holiday_table').DataTable({
   "bPaginate": false,
   "bLengthChange": false,
   "bFilter": true,
   "bSort": false,
   "bInfo": false,
   "order": [[0, 'desc']],
   //"aLengthMenu": [5, 10, 20, 30],
   'iDisplayLength': 4,
   "bAutoWidth": false
});

Upvotes: 1

Views: 2392

Answers (1)

Gyrocode.com
Gyrocode.com

Reputation: 58880

Use dom option (default value lfrtip) without f which represents filtering input.

For example:

var holiday_filter = $('#holiday_table').DataTable({
   // ... skipped ...
   'dom': 'lrtip'
});

Upvotes: 3

Related Questions