Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery datatables default filter multiple column

There is any way to set a default search value for a column in start definition?

As define a default order or default search

$('#table').dataTable({
    ajax: {url: '...'},
    order: [['0', 'asc']],
    search: { search: '...' },
    columns: [
        { data: "id" },
        { data: "name" },
        { data: "description" }
    ]
});

For column "name", I've tried

{ data: "name", search: "initial search" }
{ data: "name", search: { search: "initial search" } }
{ data: "name", search: { value: "initial search" } }

but none worked!

Any suggestions?

like image 701
Giolvani Avatar asked Feb 05 '15 01:02

Giolvani


1 Answers

Try "searchCols": for "search" as stated in the API for DT https://datatables.net/reference/option/searchCols

like image 125
jorrin Avatar answered Nov 02 '22 08:11

jorrin