Class: QueryFieldSelectView

QueryFieldSelectView()

A select interface that allows the user to search for and select metadata field(s).

Screenshot

Constructor

new QueryFieldSelectView()

Since:
  • 2.14.0
Source:

Extends

  • SearchableSelect

Members

addFields :Array.<AdditionalField>

A list of additional fields which are not retrieved from the query service index, but which should be added to the list of options. This can be used to add abstracted fields which are a combination of multiple query fields, or to add a duplicate field that has a different label.
Type:
Since:
  • 2.15.0
Source:

categoriesToAlphabetize :Array.<string>

The names of categories that should have items sorted alphabetically. Names must exactly match those in the Query Field model
Type:
  • Array.<string>
Since:
  • 2.15.0
Source:

className :string

className - the class names for this view element
Type:
  • string
Source:

commonFields :Array.<string>

A list of query fields names to display at the top of the menu, above all other category headers
Type:
  • Array.<string>
Source:

excludeFields :Array.<string>

A list of query fields names to exclude from the list of options
Type:
  • Array.<string>
Source:

excludeNonSearchable :boolean

Whether or not to exclude fields which are not searchable. Set to false to keep query fields that are not searchable in the returned list
Type:
  • boolean
Source:

inputLabel :string

Label for the input element
Type:
  • string
Source:

placeholderText :string

Text to show in the input field before any value has been entered
Type:
  • string
Source:
Default Value:
  • "accordion"
Source:
See:

type :string

The type of View this is
Type:
  • string
Source:

Methods

addTooltip(element, position) → {jQuery}

addTooltip - Add a tooltip to a given element using the description in the options object that's set on the view. This overwrites the prototype addTooltip function so that we can use popovers with more details for query select fields.
Parameters:
Name Type Description
element HTMLElement The HTML element a tooltip should be added
position string how to position the tooltip - top | bottom | left | right
Source:
Returns:
The element with a tooltip wrapped by jQuery
Type
jQuery

fieldToOption(field) → {object}

fieldToOption - Converts an object that represents a QueryField model in the format specified by the SearchableSelectView.options
Parameters:
Name Type Description
field object An object with properties corresponding to a QueryField model
Source:
Returns:
An object in the format specified by SearchableSelectView.options
Type
object

initialize(options)

Creates a new QueryFieldSelectView
Parameters:
Name Type Description
options Object A literal object with options to pass to the view
Source:

isValidOption(value) → {boolean}

isValidOption - Checks if a value is one of the values given in view.options
Parameters:
Name Type Description
value string The value to check
Source:
Returns:
returns true if the value is one of the values given in view.options
Type
boolean

postRender()

postRender - Updates the view once the dropdown UI has loaded. Processes the QueryFields given the options passed to this view, then updates the menu and selection. Processing the fields takes some time, which is why we allow the view to render before starting that process. This prevents slowing down the rendering of parent views.
Source:

processFields()

Retrieves the queryFields collection if not already fetched, then organizes the fields based on the options passed to this view.
Since:
  • 2.17.0
Source: