User Interaction
To specify when the Tooltip should be shown and hidden, set the showEvent and hideEvent properties. These properties can accept several events at once as well as an object.
The Tooltip can also be hidden when a user clicks outside it. To control this behavior of the Tooltip, use the hideOnOutsideClick property.
API
Events
To execute certain commands before or after the Tooltip was shown/hidden, handle the showing, shown, hiding or hidden event. If the event handling function is not going to be changed during the lifetime of the UI component, assign it to the corresponding onEventName property when you configure the UI component.
If you are going to change event handlers at runtime, or if you need to attach several handlers to a single event, subscribe to the events using the on(eventName, eventHandler) method.
- const hiddenEventHandler1 = function (e) {
- // First handler of the "hidden" event
- };
- const hiddenEventHandler2 = function (e) {
- // Second handler of the "hidden" event
- };
- $("#tooltipContainer").dxTooltip("instance")
- .on("hidden", hiddenEventHandler1)
- .on("hidden", hiddenEventHandler2);