How to use column().search()
How to use column().search()
Hello,
I'm using datatables in my Laravel application. I'm using this with server-side processing. Now I want to add a filter on a specific columns. If I look at the server-side manual (https://www.datatables.net/manual/server-side) I can sent parameters like columns[i][search][value]
. But how am I able to fill this search value?
I tried something like this:
Javascript:
var table = $('#tanktransacties').DataTable({
"processing": true,
"serverSide": true,
"ajax": "/tankoverzicht/data",
"searching": false
});
$('#my_custom_search').on( 'keyup', function () {
table
.columns( 4 )
.search( this.value )
.draw();
});
This redraws the table, but does not set the columns[4][search][value]
.
How do I need to call this column search..?
This question has an accepted answers - jump to answer
Answers
Aaargg.. I needed to set
searching
totrue
!Yup - if you disable searching, searching is, erm, disabled ;-)
If you want to remove the main search input, remove the
f
option fromdom
.Allan