Fixing search box outside the table, where I can choose the position of the box.
Fixing search box outside the table, where I can choose the position of the box.
Hey everyone,
I wanted to position the search box at a specific position on my website, but the table position is also changing with the search box.
I tried to add <input type="text" id="search_input">
to my html code and
var table = $('#table_id').DataTable({ ... other code ...})
$('#input_search').keyup(function(){
table.search($(this).val()).draw() ;
}),
to my JS code. But this resulted in two search boxes and when I type in something in either one of them, the text also show up in the other search box.
How is it possible to only displaying the <input type="text" id="search_input">
and not displaying the default search box from DataTables?
Or does anyone have another idea how I can solve this problem?
Kind regards,
ynynloxx
This question has an accepted answers - jump to answer
Answers
Hi @ynynloxx ,
You can remove the default search box using
dom
,Cheers,
Colin
Hey @colin
Thanks for your help. It worked.