columns().columnControl.searchClear()
Remove any ColumnControl applied search from the selected columns.
Please note - this property requires the ColumnControl extension for DataTables.
Description
Matching column().columnControl.searchClear()
, this method will remove any ColumnControl applied search term from the selected columns (all columns if no selector is provided to columns()
).
Note that the table will not be automatically redrawn when this method has been called. You need to call draw()
to display the changes as a result of the updated search.
Type
columns().columnControl.searchClear()
Remove any search that was applied to the column via ColumnControl inputs.
Returns:
DataTables.Api
:
API instance that contains a reference to the selected columns.
Example
Remove ColumnControl applied search terms from all columns:
let table = new DataTable('#myTable', {
columnControl: ['order', 'searchDropdown']
});
document.querySelector('#clearColumn').addEventListener('click', () => {
table.columns().columnControl.searchClear();
});
Related
The following options are directly related and may also be useful in your application development.