DataGridXL - API

PickerPanel

Description

The PickerPanel (shared between all DataGridXL instances) communicates with your custom picker as defined in your column settings.

Usage

The DataGridXL class has a static property pickerPanel.

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

Methods

close()

Close the picker panel Calls the `onClose` function of your custom `picker` if defined

Firespicker?.onClose
open(instance, picker, bounds, pickerPosition?, minWidth?)

Open the picker panel Calls the `onOpen` function of your custom `picker` if defined

Arguments

instance
DataGridXLYour DataGridXL instance
picker
PickerPluginA reference to your custom picker
bounds
objectTarget bounds in pixels `{ top, right, bottom, left }`
pickerPosition?
stringdefault "bottom-left"Position of picker, such as `"bottom-left"`
minWidth?
numberdefault 200Minimum panel width in pixels
Fires$beforeopen$openpicker?.onOpen
removeFocus()

Remove focus from picker panel

Fires$removefocus
setFocus()

Set focus on picker panel

Fires$setfocus
setValue(Value)

Set value of picker Calls the `onSetValue` function of your `picker` if defined

Arguments

Value
stringValue to set custom picker to, such as `"#ffffff"`
Firespicker?.onSetValue
updateCellValue(value)

Update cell value Call this method from your custom picker to keep the `CellEditor` in sync

Arguments

value
stringValue to be placed inside cell editor

Events

beforeopenPickerPanelOpenEvent

Fires before picker panel opens

Payload

type
string
Always `"beforeopen"` or `"open"`
target
PickerPanel
Instance that fired the event
payload
PickerPanelOpenEventPayload
Structured event data
openPickerPanelOpenEvent

Fires when picker panel opens

Payload

type
string
Always `"beforeopen"` or `"open"`
target
PickerPanel
Instance that fired the event
payload
PickerPanelOpenEventPayload
Structured event data
removefocusPickerPanelEvent

Fires when picker panel loses focus

Payload

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

Fires when picker panel receives focus

Payload

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