DataGridXL - API

Popover

Description

The Popover (shared between all DataGridXL instances) is the "tooltip" that appears when hovering over a data grid cell. For instance, if the cell contains a URL, a popover opens with a preview image of the given URL.

Usage

The DataGridXL class has a static property popover.

javascript
// create DataGridXL instance
const grid = new DataGridXL(...);
// work with the shared Popover instance
grid.constructor.popover.isOpen();
grid.constructor.popover.events.on('show', ...);
NOTE: You don't need to create a Popover instance yourself — it is provided by the grid automatically.

Methods

close()

Close popover

Fires$close
isOpen(): boolean

Check if popover is open

ReturnsbooleanReturns `true` if popover is open, otherwise `false`.
open(bounds, popoverPosition?, minWidth?)

Open popover

Arguments

bounds
BoundsTarget bounds in pixels `{ top, right, bottom, left }`
popoverPosition?
stringdefault "bottom-left"Position of popover, such as `"bottom-left"`
minWidth?
numberdefault 20Minimum popover width in pixels
Fires$beforeopen$open

Events

closePopoverEvent

Fires when popover closes

Payload

type
string
Type of the event (e.g. 'dblclick', 'contextmenu')
target
Popover
Instance that fired the event
mouseenterPassthroughEvent

Fires when mouse enters popover

Payload

type
string
Event name (e.g. 'copy', 'paste')
target
object
Instance that fired the event
nativeEvent
Event
The original DOM event
mouseleavePassthroughEvent

Fires when mouse leaves popover

Payload

type
string
Event name (e.g. 'copy', 'paste')
target
object
Instance that fired the event
nativeEvent
Event
The original DOM event
beforeopenPopoverOpenEvent

Fires before popover opens

Payload

type
string
Always `"beforeopen"` or `"open"`
target
Popover
Instance that fired the event
payload
PopoverOpenEventPayload
Structured event data
openPopoverOpenEvent

Fires when popover opens

Payload

type
string
Always `"beforeopen"` or `"open"`
target
Popover
Instance that fired the event
payload
PopoverOpenEventPayload
Structured event data