Executes the handler for an event on a target element.
Executes only if the component is enabled (see the enable
method).
The element from which the event originates.
The event for which to register a handler.
The function to execute when the event is triggered.
Bind an event related specially to the component option model. This will build the correct string event and execute the handler only if the component is activated.
The event type for which to register an event.
The attribute for which to register an event.
The handler to execute when the query state event is triggered.
Bind an event related specially to the query state model.
This will build the correct string event and execute the handler only if the component is activated.
The event type for which to register an event.
The attribute for which to register an event.
The handler to execute when the query state event is triggered.
Bind on the "root" of the Component. The root is typically the SearchInterface.
Bind an event using native javascript code.
The event for which to register a handler.
The function to execute when the event is triggered.
Executes the handler for the given event on the given target element.
Execute only if the component is "enabled" (see Component.enable).
Execute the handler only ONE time.
The target on which the event will originate.
The event for which to register a handler.
The function to execute when the event is triggered.
Bind an event related specially to the query state model.
This will build the correct string event and execute the handler only if the component is activated.
Will execute only once.
The event type for which to register an event.
The attribute for which to register an event.
The handler to execute when the query state event is triggered.
Bind on the "root" of the Component. The root is typically the SearchInterface.
Bind an event using native javascript code.
The handler will execute only ONE time.
The event for which to register a handler.
The function to execute when the event is triggered.
Trigger an event on the target element, with optional arguments.
The target HTMLElement on which to trigger the event.
The event to trigger.
The optional argument to pass to the handlers.
Creates a new ComponentEvents
instance for a Component
.
The
ComponentEvents
class is used by the various Coveo Component to trigger events and bind event handlers. It adds logic to execute handlers or triggers only when a component is "enabled", which serves as a way to avoid executing handlers on components that are invisible and inactive in the query.Typically, a component is disabled when it is not active in the current
Tab
. It can also be disabled by external code, however.To manually enable or disable a component, simply use its
enable
ordisable
method.