search
Set an initial search in DataTables and / or search options.
Description
The search
option allows the way DataTables performs filtering to be set during the initialisation, and to set an initial global filter.
The options that control how the search operates are defined by the DataTables.SearchOptions
object type. You can pass in an object with any or all of the options described by that parameter.
Additionally, to set an initial search term use the parameter search
in this object.
Type
This option can be given in the following type(s):
Examples
Set an initial filter:
new DataTable('#myTable', {
search: {
search: 'Fred'
}
});
Set search to use boundary conditions:
new DataTable('#myTable', {
search: {
boundary: true
}
});
Related
The following options are directly related and may also be useful in your application development.