gpadvs_settings (JS)

  1. Description
  2. Usage
  3. Parameters
  4. Since
  5. Examples
    1. Add the remove button to all GPADVS enabled fields

Description

Filter the settings object passed to Tom Select.

Tom Select is a <select> control with a bunch of extra features such auto complete and native feeling.

Usage

window.gform.filter( 'gpadvs_settings', 'my_custom_function' );

Parameters

  • settings object

    The Tom Select settings. See the “General Configuration” section in the Tom Select docs for a complete list of possible options.

  • gpadvs instance

    Current instance of the GPAdvancedSelect class.

  • selectNamespace string

    The key that Tom Select was instantiated on window.

Since

This filter is available since Gravity Forms Advanced Select 1.0-beta-1.

selectNamespace was added as a parameter in version 1.1.5.

Examples

Add the remove button to all GPADVS enabled fields

By default the remove button is only added to items in Multi Select fields. You can easily change this with the following code:

window.gform.addFilter( 'gpadvs_settings', function ( settings, gpadvs ) {
	settings.plugins.remove_button = {
		title: 'Remove item',
	};

	return settings;
} );