Interface EventListenerIf

Receives the events of a table – the fifth argument of new TableScope(…). Extend EventAdapter and override only the methods you need.

In the framework wrappers the same events arrive as callback props (mouseClicked, selectionChanged …), Vue events, Angular outputs or bubbling CustomEvents of the Web Component.

Example

class OrderEvents extends EventAdapter {
override onMouseClicked(evt: GeMouseEvent): void {
if (evt.areaIdent === "body" && evt.clickCount === 2) {
const order = tableModel.getBodyModel().getRowByIndex(evt.rowIndex); // displayed row → object
console.log("double-click on", order);
}
}
override onSelectionChanged(model: SelectionModelIf): void {
console.log(model.getRanges());
}
}
new TableScope(host, tableModel, new SimpleDomService(), new TableOptions(), new OrderEvents()).firstInit();

See

Training: Events and a context menu of your own

Hierarchy

Implemented by

Methods

  • Checked rows changed (row checkboxes, tree checkboxes) – the argument holds all checked rows.

    Parameters

    • evt: any[]

    Returns void

  • The cell editor opened, its text changed (Excel-style editing), it committed or it was cancelled. Optional.

    Parameters

    Returns void

    Since

    1.1.99

  • A click on the table. A double-click on the same cell is reported again with clickCount === 2 (after the first click with clickCount === 1).

    Parameters

    Returns void

  • Optional: a row drag ended – evt.type is "end" (dropped; evt.moved = the table moved the rows) or "cancel". Managed: called after the move (evt.toIndex = the real position). Save the new order here; to veto a drop, call evt.preventDefault() in onRowDragMove.

    Parameters

    Returns void

    Since

    1.1.95

  • Optional: the drop target of a row drag changed (not on every pixel). evt.preventDefault() marks the target as invalid (no drop marker, no drop).

    Parameters

    Returns void

    Since

    1.1.95