remove search box

remove search box

mjimmjim Posts: 3Questions: 0Answers: 0
edited May 2010 in General
How do I remove search box?

I don't need this because I want to add a select drop down to filter based on fixed values in various columns.

Thanks
Jim

Replies

  • mjimmjim Posts: 3Questions: 0Answers: 0
    Anyone? Shouldn't be too difficult for someone who knows.

    Thanks
    Jim
  • andrewmorenoandrewmoreno Posts: 10Questions: 0Answers: 0
    You could use the following two links to help you:

    I am not an expert, but you could override the sDom variable and remove the "f" that represents the filter.
    http://datatables.net/examples/basic_init/dom.html

    There is also a boolean variable for using the filter, but I do not know if setting it to false will also remove the search box.
    http://www.datatables.net/usage/features#bFilter

    Hope this helps.
  • mjimmjim Posts: 3Questions: 0Answers: 0
    "bFilter": false does hide the search form.

    Thanks Andrew.

    Jim
  • ianhickeyianhickey Posts: 1Questions: 0Answers: 0
    You could add the following to your html


    .dataTables_filter {
    display: none;
    }
  • GregPGregP Posts: 500Questions: 10Answers: 0
    edited April 2011
    I find the sDom method preferable to the bFilter method, because sDom just removes visibility while bFilter removes functionality.

    If indeed you want to remove filtering functionality altogether, bFilter false will probably also remove some unecessary event listeners, which is a good thing.
This discussion has been closed.