{hero}

searchBuilder

Since: SearchBuilder 1.0.0

A single button that displays the SearchBuilder container in a popover.
Please note - this property requires the SearchBuilder extension for DataTables.

Description

This button type creates a popover that contains the SearchBuilder container. This allows SearchBuilder to be used without it taking up extra space in the dom.

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):

action

The action function for the SearchBuilder button displays the SearchBuilder container to the user in a popover.

config

This option allows for SearchBuilder to be configured as it would in a normal initialisation. All of the searchBuilder options can be configured within this object.

init

For the SearchBuilder button the init function sets up SearchBuilder so that it is ready to be used immediately when the user presses the button.

text

  • Type: string
  • Default: Search Builder

This options allows the text within the button to be configured. This can also be configured with the language.searchBuilder.button option.

Examples

Basic SearchBuilder button initialisation:

new DataTable('#myTable', {
	layout: {
		topStart: {
			buttons: ['searchBuilder']
		}
	}
});

SearchBuilder configuration with a button:

new DataTable('#myTable', {
	layout: {
		topStart: {
			buttons: [
				{
					extend: 'searchBuilder',
					config: {
						depthLimit: 2
					}
				}
			]
		}
	}
});