JQuery datatables filters multiple columns by default

Can I set a default search value for a column in a start definition?

How to determine the default order or default search

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

In the column "name" I tried

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

but no one works!

Any suggestions?

+5
source share
1 answer

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

+4
source

Source: https://habr.com/ru/post/1212666/


All Articles