3

Possible Duplicate:
is there anyway to remove the Search bar and footer in the jquery datatable plugin

I am very new to implement datatable for sorting my column. Now, if I click on the column header, the record is sorting fine ascending and descending order. But I don't want any search field over there, as I have one customize search box. Now I am not finding how to remove the search option. Also, After getting record, I want to export the record in a csv file. According to the current record (ascending or descending order) how to do that? Please help me.

Community
  • 1
  • 1
John
  • 571
  • 2
  • 7
  • 12
  • Possible duplicate of [How can I remove the search bar and footer added by the jQuery DataTables plugin?](https://stackoverflow.com/questions/1920600/how-can-i-remove-the-search-bar-and-footer-added-by-the-jquery-datatables-plugin) – Cœur Jul 14 '18 at 13:53

2 Answers2

6

To remove the search field from your table:

JQUERY

$('table').dataTable({"bFilter": false});

CSS

.dataTables_filter {
  display: none;
}

You can read all about personalizing the jQuery DataTables here!

Zuul
  • 16,217
  • 6
  • 61
  • 88
  • 2
    You forgot about sDom! sDom will prevent whatever you want from rendering, while maintaining the functionality (unlike setting bFilter to false, which disables filtering altogether). – Greg Pettit May 16 '12 at 04:04
1
$.extend(true, $.fn.dataTable.defaults, {
    "searching": false
});
Hidde
  • 11,493
  • 8
  • 43
  • 68
Asmita Savaliya
  • 155
  • 1
  • 5