{hero}

column().columnControl.searchList()

Since: ColumnControl 1.1.0

Load new options for the search list.
Please note - this property requires the ColumnControl extension for DataTables.

Description

You might find that if the content of the data in your DataTable changes, then you need a way to have the list of options shown by searchList be updated. This method provides exactly that ability. You can instruct it either to get the options from the table, or provide a list of options yourself.

Type

column().columnControl.searchList( options )

Rebuild the search list with new options, either read from the column, or provided.

Parameters:

Returns:

DataTables.Api:
API instance that contains a reference to the selected column.

Example

Re-read the content of column index 0 and rebuild the search list:

let table = new DataTable('#myTable', {
	columnControl: ['order', ['searchList']]
});

document.querySelector('#reloadOptions0').addEventListener('click', () => {
	table.column(0).columnControl.searchList('refresh');
});

Related

The following options are directly related and may also be useful in your application development.