The user resizes a column (EventListenerIf.onColumnResizeStart, EventListenerIf.onColumnResizeEnd).

Only user actions report it – not TableApi.setColumnWidth, TableApi.applyState, TableApi.autoResizeColumns or TableApi.autoResizeColumn. The end comes once per start, after the table applied the width: in the handler TableApi.getState and the table model already have it.

Example

const listener = new EventAdapter();
listener.onColumnResizeEnd = (evt: GeColumnResizeEvent) => {
if (evt.type === "end" && evt.property) {
localStorage.setItem(`width-${evt.property}`, String(evt.newWidth));
}
};

Since

1.1.110

Hierarchy

  • GeColumnResizeEvent

Constructors

  • Parameters

    • type: GeColumnDragEventType

      Phase: "start", "end" or "cancel".

    • source: GeColumnResizeSource

      Dragging the handle or a double click on it.

    • columnIndex: number

      Model index of the column (over west, center and east).

    • columnDef: undefined | ColumnDefIf

      The column definition – undefined for a table model without column definitions.

    • property: undefined | string

      The property of the column (columnDef.property) – use it to store the width, indices change.

    • oldWidth: number

      Width in px when the drag started.

    • newWidth: number

      Width in px now: "start" = oldWidth, "end" = the new width, "cancel" = oldWidth again.

    • Optional originalEvent: Event

      The browser event behind it (mouse up, double click; undefined for TableApi.cancelColumnDrag).

    Returns GeColumnResizeEvent

Properties

columnDef: undefined | ColumnDefIf

The column definition – undefined for a table model without column definitions.

columnIndex: number

Model index of the column (over west, center and east).

newWidth: number

Width in px now: "start" = oldWidth, "end" = the new width, "cancel" = oldWidth again.

oldWidth: number

Width in px when the drag started.

originalEvent?: Event

The browser event behind it (mouse up, double click; undefined for TableApi.cancelColumnDrag).

property: undefined | string

The property of the column (columnDef.property) – use it to store the width, indices change.

Dragging the handle or a double click on it.

Phase: "start", "end" or "cancel".