How to search in a table?
How to search in a table?
danitrebu
Posts: 2Questions: 1Answers: 0
I can't find a way to implement the search bar on my website. I have tried using search(), fnFilter(), activating "searching":true, tons of examples found on the internet... and none seem to work for me. I need some help...
$('#myInput').on('keyup', function() {
table.search($(this).val()).draw();
})
also
table.fnFilter($(this).val());
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Your code works in this test case:
http://live.datatables.net/tohisudi/1/edit
Maybe you can post a link to your page or a test case showing the issue.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Thank you for your comment. I finally fixed it.
I called .DataTables instead of .dataTables, and if you call .DataTables, it seems that fnFilter and search functions are not working. I used .dataTables and edited my Ajax and it is finally working. Thank you anyway!
Yes, that would do it. Checkout this FAQ for more details.
Kevin