{hero}

ccSearchClear

Since: ColumnControl 1.0.0

A button to clear ColumnControl searches when triggered.
Please note - this property requires the ColumnControl extension for DataTables.

Description

This button type will, when triggered, cause all ColumnControl search inputs to be cleared. It will also clear any global search applied to the DataTable and then redraw the table. It can be useful for cases when you want to provide the end user with a way to quickly clear all searches that they might have applied to the table.

The search input types cleared are:

Options

This button can have the following options set in its configuration object to customise its actions and display, in addition to those options which are available for all buttons (e.g. buttons.buttons.text):

text

  • Type: string
  • Default: Clear search

Text shown in the button.

Example

ColumnControl search inputs with a clear button:

new DataTable('#example', {
	columnControl: [
		{
			target: 0,
			content: ['orderStatus']
		},
		{
			target: 1,
			content: ['search']
		}
	],
	layout: {
		topStart: {buttons: ['pageLength', 'ccSearchClear']}
	},
	ordering: {
		indicators: false
	}
});