Reputation: 25
i am using Datatables and i want to make the search box "filtration" applied on a specific columns like "name" and "email" , is it possible and how ?
thanks
Upvotes: 2
Views: 10702
Reputation: 1666
use columnsDef
OR columns
options.
The code disabled search for the specified columns base on Column Index.
'columnDefs' : [ // see https://datatables.net/reference/option/columns.searchable
{
'searchable' : false,
'targets' : [0,1,4]
},
]
"columns": [
{ "searchable": false },
null,
null,
null,
null
]
Go thro this link https://datatables.net/reference/option/columns.searchable
Upvotes: 4
Reputation: 749
Yes, use columns().search()
instead of filter()
.
Click here for more details on datatables.net, including examples
Upvotes: 0