A specialized subclass of ToolTipQueryEventArgs that carries the item for which the tool tip is queried.
Type Parameters
- TModelItem
- The type of the
.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.QueryItemToolTipEventArgs
Constructors
Initializes a new instance of the QueryItemToolTipEventArgs<TModelItem> class.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context to yield the tool tip for.
- queryLocation - Point
- The query location.
- item - TModelItem
- The item for which the tool tip is queried..
Properties
Gets the context for the current event.
Defined in
Gets or sets a value indicating whether this ToolTipQueryEventArgs has been handled.
Remarks
If this property is set to true
, the content of the toolTip property will be displayed as tooltip. Otherwise, the input mode will continue determining the tooltip contents, typically by querying for the content with another graph item at the current queryLocation.
Handlers which handle this ToolTipQueryEventArgs should always test first, whether this property is set to true
and, if so, exit without doing anything.
This property is automatically set to true
if the toolTip has been assigned a value.
Defined in
Gets the query location in world coordinates.
Defined in
Gets or sets the tooltip content to use.
Remarks
The content can be either a string, any HTML element or a Promise providing the same.
Setting this property will set the handled property to true
.
// For example, set a string as tooltip
eventArgs.toolTip = 'Tooltip for Item'
// or set an HTML element as tooltip
const div = document.createElement('div')
div.innerHTML = 'Tooltip for Item'
eventArgs.toolTip = div
// or set a Promise as tooltip, whose resolve value will be displayed
// note that the tooltip must be set synchronous in the event handler, thus awaiting it here won't work
eventArgs.toolTip = fetch('something.txt').then((response) => response.text())