Reputation: 53
I want to search table by only two columns. E.g. Initial search searches in all columns, I just want to search by two columns. When I use following code:
dataTable.columns([1,7])
.search("some string")
.draw();
the search text must be present in both columns to be displayed. I want to display it even if it exists in one of the columns. Can anyone help?
Thanks
Upvotes: 0
Views: 2783
Reputation: 53
SOLVED
I've changed searching to initial which searches all columns:
dataTable
.search(this.value)
.draw();
And set columns which I don't want to be search in initTable:
"columnDefs": [
{
"targets": [2,5],
"searchable": false
}]
Upvotes: 1