Search by two columns
Search by two columns
gruchaap
Posts: 2Questions: 1Answers: 0
Hi all,
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(this.value)
.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,
gruchaap
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Two options:
columns.searchable
Allan
Thank you! SOLVED thanks to you.
Changes in code:
I've changed searching to initial which searches all columns:
And set columns which I don't want to be search in initTable: