Can you hide the Search box without disabling searching?
Can you hide the Search box without disabling searching?
Sarcoth
Posts: 3Questions: 1Answers: 0
Here is what I have and it is working:
$(document).ready(function() {
$('.mytable').dataTable( {
searching: true
} );
$('.mytable').DataTable().column( 7 ).search('SearchText').draw();
} );
Now, I would like to hide the global search box, but keep the default search I am performing. Is there a way to do that?
This discussion has been closed.
Answers
As a workaround for this, I manually added "visibility: hidden" to the css file as follows:
.dataTables_wrapper .dataTables_filter {
float: right;
text-align: right;
visibility: hidden;
}
This hides the search box. I would have preferred a way to do it within the javascript, but this does the trick.
I think the search box is located in the dom and you just have to take out the letter that stands for the search box. I may be incorrect though.
Yes - the
dom
option is how to do it. Remove thef
option (f
for filter).Allan
Modgility and allan, thank you for the reply. I used dom in the older version like that, but I wasn't sure that was the same way to do it now when using the newer commands. This works perfectly. Thanks again.
You're welcome. Sorry I couldn't remember what letter it was :)