Constructor
new QueryFieldSelectView()
- Since:
- Source:
Extends
Members
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:
- 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:
- Since:
- Source:
className :string
className - the class names for this view element
Type:
- Source:
commonFields :Array.<string>
A list of query fields names to display at the top of the menu, above
all other category headers
Type:
- Source:
excludeFields :Array.<string>
A list of query fields names to exclude from the list of options
Type:
- 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:
- Source:
Label for the input element
Type:
- Source:
placeholderText :string
Text to show in the input field before any value has been entered
Type:
- Source:
- Default Value:
- Source:
- See:
-
type :string
The type of View this is
Type:
- Source:
Methods
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:
- Source: