Class CellEditorAbstract

An abstract base class that provides the most of the functionality needed by a cell editor. All of the built-in cell editors for various cell types are derived from this base class. Custom cell editors can be easily implemented by extending this class.

Hierarchy (view full)

Implements

Constructors

Properties

_disposed: boolean = false

Whether the cell editor is disposed.

_gridWheelEventHandler: null | ((this, ev) => any) = null

Grid wheel event handler.

Type declaration

_validInput: boolean = true

Whether the value input is valid.

Cell configuration data for the cell being edited.

editorContainer: HTMLDivElement

The div element used to contain and position editor widget.

inputChanged: Signal<CellEditor, void> = ...

A signal emitted when input changes.

onCancel?: (() => void)

Callback method to call on cell edit cancel.

Type declaration

    • (): void
    • Returns void

onCommit?: ((response) => void)

Callback method to call on cell edit commit.

Type declaration

validator: undefined | ICellInputValidator

Cell input validator to use for the cell being edited.

validityNotification: null | Notification = null

Notification popup used to show validation error messages.

viewportOccluder: HTMLDivElement

The div element used to prevent editor widget overflow beyond grid viewport.

Accessors

Methods

  • Create container elements needed to prevent editor widget overflow beyond viewport and to position cell editor widget.

    Returns void

  • Commit the edited value.

    Parameters

    • cursorMovement: CursorMoveDirection = 'none'

      Cursor move direction based on keys pressed to end the edit.

    Returns boolean

    true on valid input, false otherwise.

  • Return the current input entered. This method throws exceptions if input is invalid. Error message in exception is shown as notification.

    Returns any

  • Set validity flag.

    Parameters

    • valid: boolean

      Whether the input is valid.

    • message: string = ''

      Notification message to show.

      If message is set to empty string (which is the default) existing notification popup is removed if any.

    Returns void

  • Start editing the cell. Usually an editor widget is created and added to editorContainer

    Returns void

  • Reposition cell editor by moving viewport occluder and cell editor container.

    Returns void

  • Validate the cell input. Shows validation error notification when input is invalid.

    Returns void