Builds and returns an HTMLElement for the given result.
the result to build an HTMLElement from.
Builds and returns an array of HTMLElement with the given result set.
the result set to build an array of HTMLElement from.
Return the debug info about this component.
Disable the component. Normally this means that the component will not execute handlers for the framework events (query events, for example). Components are enabled by default on creation.
Executes a query to fetch new results. After the query returns, renders the new results.
Asserts that there are more results to display by verifying whether the last query has returned as many results as requested.
Asserts that the ResultList
is not currently fetching results.
The number of results to fetch and display.
Enable the component. Normally this means that the component will execute handlers for the framework events (query events, for example). Components are enabled by default on creation.
Get the fields needed to be automatically included in the query for this result list.
Return the bindings, or environment, for the current component.
Gets the list of currently displayed result.
Gets the list of currently displayed result HTMLElement.
Empties the current result list content and appends the given array of HTMLElement.
Can append to existing elements in the result list, or replace them.
Triggers the newResultsDisplayed
and newResultDisplayed
events.
Get the bound component to the given HTMLElement. Throws an assert if the HTMLElement has no component bound, unless using the noThrow argument.
If there is multiple component bound to the current HTMLElement, you must specify the component class.
HTMLElement for which to get the bound component.
Optional component class. If the HTMLElement has multiple components bound, you must specify which one you are targeting.
Boolean option to tell the method to not throw on error.
Allows the component to bind events and execute them only when it is enabled.
Contains the state of options for different components. Mainly used by ResultLink.
Contains the state of different components (enabled vs disabled). Allows to get/set values. Triggers component state event when modified. Each component can listen to those events.
A disabled component will not participate in the query, or listen to ComponentEvents.
Allows component to log in the dev console.
Contains the singleton that allows to trigger queries.
Contains the state of the query. Allows to get/set values. Trigger query state event when modified. Each component can listen to those events.
A reference to the root HTMLElement (the SearchInterface).
A reference to the root of every component, the SearchInterface.
The static ID that each component needs in order to be identified.
For example, SearchButton -> static ID: SearchButton -> className: CoveoSearchButton
A reference to the Analytics.client.
Whether the ResultList
should scan its result templates to discover which fields it must request to
be able to render all results.
Setting this option to true
ensures that the Coveo Search API does not return fields that are unnecessary for
the UI to function.
If you set this option to true
, the fields referenced in your result folding templates won't be automatically resolved.
In such a case, you must manually specify those fields using the fieldsToInclude
option.
Notes:
true
.true
in the Coveo for Sitecore integration.data-auto-select-fields-to-include='true' data-auto-select-fields-to-include='false'
Whether to automatically retrieve an additional page of results and append it to the
results that the ResultList
is currently displaying when the user scrolls down to the bottom of the
infiniteScrollContainer
.
See also the infiniteScrollPageSize
and
enableInfiniteScrollWaitingAnimation
options.
It is important to specify the infiniteScrollContainer
option manually if you want the scrolling element to be
something else than the default window
element. Otherwise, you might find yourself in a strange state where the
framework rapidly triggers multiple successive query.
data-enable-infinite-scroll='true' data-enable-infinite-scroll='false'
Whether to display the waitingAnimation
while fetching additional
results.
data-enable-infinite-scroll-waiting-animation='true' data-enable-infinite-scroll-waiting-animation='false'
Whether to scroll back to the top of the page when the end-user:
infiniteScrollContainer
is set to true
Pager
component when infiniteScrollContainer
is set to false
Note: Setting this option to false
has no effect on dynamic facets. To disable this behavior on a DynamicFacet
component, you must set its own enableScrollToTop
option to false
.
data-enable-scroll-to-top='true' data-enable-scroll-to-top='false'
A list of fields to include in the query results.
If you set the autoSelectFieldsToInclude
option to
true
, the Coveo Search API returns the fields you specify for this option (if those fields are available) in
addition to the fields which the ResultList
automatically requests. Note that the autoSelectFieldsToInclude
option doesn't automatically request fields for folding templates; in such a case, you must manually specify
fields using this option to avoid empty results.
If you set the autoSelectFieldsToInclude
option to
false
, the Coveo Search API only returns the fields you specify for this option (if those fields are
available).
If you set the autoSelectFieldsToInclude
option to
false
and leave this option undefined, the Coveo Search API returns all available fields.
The element that triggers fetching additional results when the end user scrolls down to its bottom.
You can change the container by specifying its selector (e.g.,
data-infinite-scroll-container-selector='#someCssSelector'
).
By default, the framework uses the first vertically scrollable parent element it finds, starting from the
ResultList
element itself. A vertically scrollable element is an element whose CSS overflow-y
attribute is
scroll
.
This implies that if the framework can find no scrollable parent, it uses the window
itself as a scrollable
container.
This heuristic is not perfect, for technical reasons. There are always some corner case CSS combination which the framework will not be able to correctly detect as 'scrollable'.
It is highly recommended that you manually set this option if you wish something else than the window
to be the
scrollable element.
The number of additional results to fetch when the user scrolls down to the bottom of the
infiniteScrollContainer
.
data-infinite-scroll-page-size='5'
Specifies the layout to use when displaying results in this ResultList
(see
Result Layouts). Specifying a value for this option automatically
populates a [ResultLayout
]{@link ResultLayout} component with a switcher for the layout.
For example, if there are two ResultList
components in the page, one with its layout
set to list
and the
other with the same option set to card
, then the ResultLayout
component will render two buttons respectively
entitled List and Card.
See the ValidLayout
type for the list of possible values.
data-layout='card'
The element inside which to insert the rendered result templates.
Performing a new query clears the content of this element.
You can change the container by specifying its selector (e.g.,
data-result-container-selector='#someCssSelector'
).
If you specify no value for this option, a div
element will be dynamically created and appended to the result
list. This element will then be used as a result container.
The type of animation to display while waiting for a query to return.
The possible values are:
fade
: Fades out the current list of results while the query is executing.spinner
: Shows a spinning animation while the query is executing.none
: Use no animation during queries.See also the waitAnimationContainer
option.
data-wait-animation='spinner'
The element inside which to display the waitAnimation
.
You can change this by specifying a CSS selector (e.g.,
data-wait-animation-container-selector='#someCssSelector'
).
Defaults to the value of the resultsContainer
option.
Creates a new ResultList
component. Binds various event related to queries (e.g., on querySuccess ->
renderResults). Binds scroll event if the enableInfiniteScroll
option is true
.
The HTMLElement on which to instantiate the component.
The options for the ResultList
component.
The bindings that the component requires to function normally. If not set, these will be automatically resolved (with a slower execution time).
The class that this component should instantiate. Components that extend the base ResultList
use this. Default value is CoveoResultList
.
The
ResultList
component is responsible for displaying query results by applying one or several result templates (see Result Templates).It is possible to include multiple
ResultList
components along with a singleResultLayout
component in a search page to provide different result layouts (see Result Layouts).This component supports infinite scrolling (see the
enableInfiniteScroll
option).