7

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?

1 Answer 1

6

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.